From 2a22b180e4b9d31826612136a8db72335393e8cb Mon Sep 17 00:00:00 2001 From: spital <11034264+spital@users.noreply.github.com> Date: Tue, 2 Jun 2026 20:30:08 +0200 Subject: [PATCH] Bump Clippy and rustfmt toolchain to Rust 1.96 Update the CI build/lint Rust toolchain from 1.92 to 1.96 and fix the lint warnings exposed by newer Clippy versions. --- .github/workflows/main.yml | 2 +- rustworkx-core/src/bipartite_coloring.rs | 4 ++-- rustworkx-core/src/coloring.rs | 2 +- rustworkx-core/src/planar/lr_planar.rs | 12 +++++------- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4c344015f0..3829911ecd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,7 +28,7 @@ jobs: python-version: "3.12" - run: | pip install -U --group lint - - uses: dtolnay/rust-toolchain@1.92 # TODO: unpin clippy + - uses: dtolnay/rust-toolchain@1.96 with: components: rustfmt, clippy - name: Test Build diff --git a/rustworkx-core/src/bipartite_coloring.rs b/rustworkx-core/src/bipartite_coloring.rs index f7da154f18..f67494c311 100644 --- a/rustworkx-core/src/bipartite_coloring.rs +++ b/rustworkx-core/src/bipartite_coloring.rs @@ -650,7 +650,7 @@ mod test_bipartite_coloring { // Check that every edge has valid color for edge in graph.edge_references() { if !colors.contains_key(&edge.id()) { - panic!("Edge {:?} has no color assigned.", &edge.id()); + panic!("Edge {:?} has no color assigned.", edge.id()); } } @@ -690,7 +690,7 @@ mod test_bipartite_coloring { // Check that every edge has valid color for edge in graph.edge_references() { if !colors.contains_key(&edge.id()) { - panic!("Edge {:?} has no color assigned.", &edge.id()); + panic!("Edge {:?} has no color assigned.", edge.id()); } } diff --git a/rustworkx-core/src/coloring.rs b/rustworkx-core/src/coloring.rs index 9fa74577fd..da7537e633 100644 --- a/rustworkx-core/src/coloring.rs +++ b/rustworkx-core/src/coloring.rs @@ -1684,7 +1684,7 @@ mod test_misra_gries_edge_coloring { // Check that every edge has valid color for edge in graph.edge_references() { if !colors.contains_key(&edge.id()) { - panic!("Problem: edge {:?} has no color assigned.", &edge.id()); + panic!("Problem: edge {:?} has no color assigned.", edge.id()); } } diff --git a/rustworkx-core/src/planar/lr_planar.rs b/rustworkx-core/src/planar/lr_planar.rs index fb44a95129..ecc90da974 100644 --- a/rustworkx-core/src/planar/lr_planar.rs +++ b/rustworkx-core/src/planar/lr_planar.rs @@ -280,13 +280,11 @@ where self.lowpt.insert(ei, v_height); self.lowpt_2.insert(ei, w_height); } - DfsEvent::BackEdge(v, w, _) => { - // do *not* consider ``(v, w)`` as a back edge if ``(w, v)`` is a tree edge. - if Some(&(w, v)) != self.eparent.get(&v) { - let ei = (v, w); - self.lowpt.insert(ei, self.height[&w]); - self.lowpt_2.insert(ei, self.height[&v]); - } + // Do *not* consider ``(v, w)`` as a back edge if ``(w, v)`` is a tree edge. + DfsEvent::BackEdge(v, w, _) if Some(&(w, v)) != self.eparent.get(&v) => { + let ei = (v, w); + self.lowpt.insert(ei, self.height[&w]); + self.lowpt_2.insert(ei, self.height[&v]); } DfsEvent::Finish(v, _) => { for edge in self.graph.edges(v) {