diff --git a/src/commands/new.rs b/src/commands/new.rs index 674be3d..a43a246 100644 --- a/src/commands/new.rs +++ b/src/commands/new.rs @@ -29,7 +29,6 @@ fn prompt_input Result<(), String>>(prompt_text: &str, predicate: let mut buffer = String::new(); io::stdin() .read_line(&mut buffer) - .ok() .expect("Failed to read line"); let answer = buffer.trim_end().to_string(); match predicate(&answer) { diff --git a/src/commands/serve.rs b/src/commands/serve.rs index 8413c13..1e26bd3 100644 --- a/src/commands/serve.rs +++ b/src/commands/serve.rs @@ -104,7 +104,7 @@ impl IndexServer { } } - fn create_hit(&self, score: Score, doc: &Document, doc_address: &DocAddress) -> Hit { + fn create_hit(&self, score: Score, doc: &Document, doc_address: DocAddress) -> Hit { Hit { score, doc: self.schema.to_named_doc(&doc), @@ -129,7 +129,7 @@ impl IndexServer { .iter() .map(|(score, doc_address)| { let doc: Document = searcher.doc(*doc_address).unwrap(); - self.create_hit(*score, &doc, doc_address) + self.create_hit(*score, &doc, *doc_address) }) .collect() };