浏览代码

Fix no_std

jD91mZM2 6 年之前
父节点
当前提交
e88e0d77bd
共有 2 个文件被更改,包括 3 次插入2 次删除
  1. 1 1
      src/lib.rs
  2. 2 1
      src/matcher.rs

+ 1 - 1
src/lib.rs

@@ -4,7 +4,7 @@
 #![feature(nll)]
 #![feature(nll)]
 
 
 #[cfg(feature = "no_std")]
 #[cfg(feature = "no_std")]
-#[cfg_attr(test, macro_use)]
+#[macro_use]
 extern crate alloc;
 extern crate alloc;
 
 
 #[cfg(feature = "no_std")]
 #[cfg(feature = "no_std")]

+ 2 - 1
src/matcher.rs

@@ -475,7 +475,7 @@ impl<'a> PosixRegexMatcher<'a> {
                     let mut prev = branch.prev.clone();
                     let mut prev = branch.prev.clone();
                     branch.push_to_prev(&mut prev);
                     branch.push_to_prev(&mut prev);
 
 
-                    for &(ref key, group) in &prev {
+                    for &(_, group) in &prev {
                         self.groups.push(group);
                         self.groups.push(group);
                     }
                     }
                 }
                 }
@@ -518,6 +518,7 @@ mod tests {
             .compile()
             .compile()
             .expect("error compiling regex")
             .expect("error compiling regex")
     }
     }
+    #[cfg(feature = "bench")]
     fn matches(regex: &str, input: &str) -> Vec<PosixRegexResult> {
     fn matches(regex: &str, input: &str) -> Vec<PosixRegexResult> {
         compile(regex)
         compile(regex)
             .matches(input.as_bytes())
             .matches(input.as_bytes())