From 390097b5b8eea407285d8ab06ce8f2fd0cb90f37 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Fri, 26 Jul 2019 12:49:25 +0300 Subject: [PATCH] remove debug break + clippy --- src/main.rs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/main.rs b/src/main.rs index 7c990d1..50d60d7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -115,13 +115,13 @@ fn parse_file(file: impl io::Read) -> Result { use KeywordType::*; @@ -129,14 +129,11 @@ fn parse_file(file: impl io::Read) -> Result { - ctx.cur_question_pre["id"] = line_s.replace(":", "").as_str().into(); - } - _ => (), + if let Some(QuestionStart) = ctx.cur_keyword_type { + ctx.cur_question_pre["id"] = line_s.replace(':', "").as_str().into(); }; // apply accumulated content when new keyword found @@ -222,9 +219,6 @@ fn main() -> Result<(), Box> { let mut outfile = fs::File::create(outfilename)?; data.write_pretty(&mut outfile, 1)?; - //data.write(&mut outfile)?; - //debug - break; } Ok(()) }