From d88f18b4510a14f103066cd30eed3c39266ebaf2 Mon Sep 17 00:00:00 2001 From: danielleodigie <97267313+danielleodigie@users.noreply.github.com> Date: Mon, 17 Jul 2023 10:52:36 -0400 Subject: [PATCH] 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. --- rustworkx-core/src/connectivity/cycle_basis.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rustworkx-core/src/connectivity/cycle_basis.rs b/rustworkx-core/src/connectivity/cycle_basis.rs index 49b8ca663..630d24c13 100644 --- a/rustworkx-core/src/connectivity/cycle_basis.rs +++ b/rustworkx-core/src/connectivity/cycle_basis.rs @@ -76,9 +76,8 @@ where let mut used: HashMap> = 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) {