From 35be20da8bc8d3ab5b5020386a335fa5bf7a95be Mon Sep 17 00:00:00 2001 From: Mathieu David Date: Sat, 18 Jul 2015 16:21:04 +0200 Subject: [PATCH] Fixed bug where spaces where not trimmed and only the first level was parsed correctly --- src/parse/summary.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parse/summary.rs b/src/parse/summary.rs index ba38f647..45425430 100644 --- a/src/parse/summary.rs +++ b/src/parse/summary.rs @@ -78,11 +78,11 @@ fn level(line: &str, spaces_in_tab: i32) -> Result { } -fn parse_line(line: &str) -> Option { +fn parse_line(l: &str) -> Option { let mut name; let mut path; // Remove leading and trailing spaces or tabs - line.trim_matches(|c: char| { c == ' ' || c == '\t' }); + let mut line = l.trim_matches(|c: char| { c == ' ' || c == '\t' }); if let Some(c) = line.chars().nth(0) { match c {