Skip to content

Commit 3ee152a

Browse files
authored
dot-dsl: Replace filter(p).next() with find(p) (#1024)
clippy::filter_next https://rust-lang.github.io/rust-clippy/master/index.html#filter_next Helps address #1012
1 parent 7153736 commit 3ee152a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

exercises/dot-dsl/example.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub mod graph {
4040
}
4141

4242
pub fn get_node(&self, name: &str) -> Option<&Node> {
43-
self.nodes.iter().filter(|n| n.name == name).next()
43+
self.nodes.iter().find(|n| n.name == name)
4444
}
4545
}
4646

0 commit comments

Comments
 (0)