Skip to content

Commit 9d1cebc

Browse files
committed
fix: fixed clippy issues
1 parent a6b21b9 commit 9d1cebc

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/bin/simstring.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,8 @@ fn run_search_logic<M: Measure>(
233233
let searcher = Searcher::new(db, measure);
234234
if queries.is_empty() {
235235
let stdin = io::stdin();
236-
for line in stdin.lock().lines() {
237-
if let Ok(query) = line {
238-
perform_search_ref(&searcher, &query, threshold, ranked, output, quiet);
239-
}
236+
for query in stdin.lock().lines().map_while(Result::ok) {
237+
perform_search_ref(&searcher, &query, threshold, ranked, output, quiet);
240238
}
241239
} else {
242240
for query in queries {

tests/test_file_loading.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ fn test_load_text_file() {
99
let mut file = NamedTempFile::new().unwrap();
1010
writeln!(file, "hello").unwrap();
1111
writeln!(file, "world").unwrap();
12-
writeln!(file, "").unwrap(); // Empty line should be skipped
12+
writeln!(file).unwrap(); // Empty line should be skipped
1313
writeln!(file, " test ").unwrap(); // Whitespace should NOT be trimmed
1414

1515
let strings = load_text_file(file.path()).unwrap();

0 commit comments

Comments
 (0)