Skip to content

Commit

Permalink
Apply clippy lint: Avoid potential infinite loop
Browse files Browse the repository at this point in the history
Detailed explanation in https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok
We're unlikely to hit this, because `entry` is a file and thus continued
read errors are unlikely.
But better be safe than sorry.
  • Loading branch information
badboy committed Apr 26, 2023
1 parent 63680ee commit dd5c3eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion glean-core/src/event_database/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ impl EventDatabase {
db.insert(
store_name,
file.lines()
.filter_map(|line| line.ok())
.map_while(Result::ok)
.filter_map(|line| serde_json::from_str::<StoredEvent>(&line).ok())
.collect(),
);
Expand Down

0 comments on commit dd5c3eb

Please sign in to comment.