Skip to content

Commit

Permalink
refactor(network-parser): use map_while
Browse files Browse the repository at this point in the history
  • Loading branch information
cndolo committed Feb 9, 2024
1 parent 3b70ebc commit bfa29a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion network-parser/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ pub fn read_node_rankings_from_file(
let file = File::open(path).unwrap_or_else(|_| panic!("Error reading {}.", path.display()));
let reader = BufReader::new(file);
let mut ranks: NodeRanks = vec![];
for line in reader.lines().flatten() {
for line in reader.lines().map_while(Result::ok) {
if nodes.contains(&line) {
ranks.push(line);
}
Expand Down

0 comments on commit bfa29a5

Please sign in to comment.