Skip to content

Commit

Permalink
style: include set_contains_or_insert (#797)
Browse files Browse the repository at this point in the history
  • Loading branch information
vil02 authored Oct 1, 2024
1 parent a8ec294 commit b318350
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ suspicious_operation_groupings = { level = "allow", priority = 1 }
use_self = { level = "allow", priority = 1 }
while_float = { level = "allow", priority = 1 }
needless_pass_by_ref_mut = { level = "allow", priority = 1 }
set_contains_or_insert = { level = "allow", priority = 1 }
# cargo-lints:
cargo_common_metadata = { level = "allow", priority = 1 }
# style-lints:
Expand Down
3 changes: 1 addition & 2 deletions src/graph/breadth_first_search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ pub fn breadth_first_search(graph: &Graph, root: Node, target: Node) -> Option<V

// Check the neighboring nodes for any that we've not visited yet.
for neighbor in currentnode.neighbors(graph) {
if !visited.contains(&neighbor) {
visited.insert(neighbor);
if visited.insert(neighbor) {
queue.push_back(neighbor);
}
}
Expand Down

0 comments on commit b318350

Please sign in to comment.