From 69c385e8105c7fad07a5728979e86a2a6a5e88ba Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 30 Jul 2018 16:32:27 +0300 Subject: Fix compilation for real --- cli/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cli/src') diff --git a/cli/src/main.rs b/cli/src/main.rs index 94183c552..f87878137 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -55,12 +55,12 @@ fn read_stdin() -> Result { fn render_test(file: &Path, line: usize) -> Result<(String, String)> { let text = fs::read_to_string(file)?; let tests = collect_tests(&text); - let test = tests.into_iter().find(|t| { - t.start_line <= line && line <= t.start_line + t.text.lines().count() + let test = tests.into_iter().find(|(start_line, t)| { + *start_line <= line && line <= *start_line + t.text.lines().count() }); let test = match test { None => bail!("No test found at line {} at {}", line, file.display()), - Some(test) => test, + Some((_start_line, test)) => test, }; let file = libsyntax2::parse(test.text.clone()); let tree = libsyntax2::utils::dump_tree(&file); -- cgit v1.2.3