Skip to content

Commit

Permalink
Adding fix that clippy warns for (#930)
Browse files Browse the repository at this point in the history
Because of a new Rust update, Clippy now warned for a line of code in cycle_basis.rs in rustworkx-core.
This PR fixes that one line so that Clippy passes.
  • Loading branch information
danielleodigie committed Jul 17, 2023
1 parent a4ffb6e commit d88f18b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions rustworkx-core/src/connectivity/cycle_basis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,8 @@ where
let mut used: HashMap<G::NodeId, HashSet<G::NodeId>> = HashMap::new();
used.insert(root_index, HashSet::new());
// Walk the spanning tree
while !stack.is_empty() {
// Use the last element added so that cycles are easier to find
let z = stack.pop().unwrap();
// Use the last element added so that cycles are easier to find
while let Some(z) = stack.pop() {
for neighbor in graph.neighbors(z) {
// A new node was encountered:
if !used.contains_key(&neighbor) {
Expand Down

0 comments on commit d88f18b

Please sign in to comment.