aboutsummaryrefslogtreecommitdiff
path: root/cli/src/main.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-07-30 14:32:27 +0100
committerAleksey Kladov <[email protected]>2018-07-30 14:32:27 +0100
commit69c385e8105c7fad07a5728979e86a2a6a5e88ba (patch)
tree10e58c3bc358d184139b897bada3800f37f6096d /cli/src/main.rs
parent67424000a9decccda44f4303d00d91a4fca985ba (diff)
Fix compilation for real
Diffstat (limited to 'cli/src/main.rs')
-rw-r--r--cli/src/main.rs6
1 files changed, 3 insertions, 3 deletions
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<String> {
55fn render_test(file: &Path, line: usize) -> Result<(String, String)> { 55fn render_test(file: &Path, line: usize) -> Result<(String, String)> {
56 let text = fs::read_to_string(file)?; 56 let text = fs::read_to_string(file)?;
57 let tests = collect_tests(&text); 57 let tests = collect_tests(&text);
58 let test = tests.into_iter().find(|t| { 58 let test = tests.into_iter().find(|(start_line, t)| {
59 t.start_line <= line && line <= t.start_line + t.text.lines().count() 59 *start_line <= line && line <= *start_line + t.text.lines().count()
60 }); 60 });
61 let test = match test { 61 let test = match test {
62 None => bail!("No test found at line {} at {}", line, file.display()), 62 None => bail!("No test found at line {} at {}", line, file.display()),
63 Some(test) => test, 63 Some((_start_line, test)) => test,
64 }; 64 };
65 let file = libsyntax2::parse(test.text.clone()); 65 let file = libsyntax2::parse(test.text.clone());
66 let tree = libsyntax2::utils::dump_tree(&file); 66 let tree = libsyntax2::utils::dump_tree(&file);