From 67424000a9decccda44f4303d00d91a4fca985ba Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 30 Jul 2018 16:25:10 +0300 Subject: [PATCH] Fix compilation --- tools/src/lib.rs | 10 +++++++++- tools/src/main.rs | 7 ------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/tools/src/lib.rs b/tools/src/lib.rs index 157818bdf9..1b7ef3ca9c 100644 --- a/tools/src/lib.rs +++ b/tools/src/lib.rs @@ -1,4 +1,6 @@ extern crate itertools; + +use std::hash; use itertools::Itertools; #[derive(Debug, Eq)] @@ -14,6 +16,12 @@ impl PartialEq for Test { } } +impl hash::Hash for Test { + fn hash(&self, state: &mut H) { + self.name.hash(state) + } +} + pub fn collect_tests(s: &str) -> Vec { let mut res = vec![]; let prefix = "// "; @@ -21,7 +29,7 @@ pub fn collect_tests(s: &str) -> Vec { .lines() .map(str::trim_left) .enumerate() - .group_by(|(idx, line)| line.starts_with(prefix)); + .group_by(|(_idx, line)| line.starts_with(prefix)); 'outer: for (is_comment, block) in comment_blocks.into_iter() { if !is_comment { diff --git a/tools/src/main.rs b/tools/src/main.rs index 671f053884..783e3395b9 100644 --- a/tools/src/main.rs +++ b/tools/src/main.rs @@ -96,13 +96,6 @@ fn gen_tests(verify: bool) -> Result<()> { Ok(()) } - -impl ::std::hash::Hash for Test { - fn hash(&self, state: &mut H) { - self.name.hash(state) - } -} - fn tests_from_dir(dir: &Path) -> Result> { let mut res = HashSet::new(); for entry in ::walkdir::WalkDir::new(dir) {