Skip to content

Commit b318350

Browse files
authored
style: include set_contains_or_insert (#797)
1 parent a8ec294 commit b318350

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ suspicious_operation_groupings = { level = "allow", priority = 1 }
167167
use_self = { level = "allow", priority = 1 }
168168
while_float = { level = "allow", priority = 1 }
169169
needless_pass_by_ref_mut = { level = "allow", priority = 1 }
170-
set_contains_or_insert = { level = "allow", priority = 1 }
171170
# cargo-lints:
172171
cargo_common_metadata = { level = "allow", priority = 1 }
173172
# style-lints:

src/graph/breadth_first_search.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ pub fn breadth_first_search(graph: &Graph, root: Node, target: Node) -> Option<V
3434

3535
// Check the neighboring nodes for any that we've not visited yet.
3636
for neighbor in currentnode.neighbors(graph) {
37-
if !visited.contains(&neighbor) {
38-
visited.insert(neighbor);
37+
if visited.insert(neighbor) {
3938
queue.push_back(neighbor);
4039
}
4140
}

0 commit comments

Comments
 (0)