Skip to content

Commit 55a3610

Browse files
danielleodigieraynelfss
authored andcommitted
Adding fix that clippy warns for (#930)
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.
1 parent 57d8ab1 commit 55a3610

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

rustworkx-core/src/connectivity/cycle_basis.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,8 @@ where
9191
let mut used: HashMap<G::NodeId, HashSet<G::NodeId>> = HashMap::new();
9292
used.insert(root_index, HashSet::new());
9393
// Walk the spanning tree
94-
while !stack.is_empty() {
95-
// Use the last element added so that cycles are easier to find
96-
let z = stack.pop().unwrap();
94+
// Use the last element added so that cycles are easier to find
95+
while let Some(z) = stack.pop() {
9796
for neighbor in graph.neighbors(z) {
9897
// A new node was encountered:
9998
if !used.contains_key(&neighbor) {

0 commit comments

Comments
 (0)