From 4972b4a8a6ca8a3df58275730b21037433634791 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Thu, 5 Oct 2023 16:24:54 -0400 Subject: [PATCH] Fix build errors with Rust 1.73.0 The recent Rust 1.73.0 release introduced some changes to clippy's behavior that are causing failures in CI (and correctly calling out issues in our code). This commit updates the rustworkx source to correct these failures. --- rustworkx-core/src/centrality.rs | 2 +- src/dag_algo/mod.rs | 1 - src/matching/mod.rs | 2 +- src/score.rs | 1 + 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rustworkx-core/src/centrality.rs b/rustworkx-core/src/centrality.rs index c099c6304..2d856244f 100644 --- a/rustworkx-core/src/centrality.rs +++ b/rustworkx-core/src/centrality.rs @@ -738,7 +738,7 @@ where { let alpha: f64 = alpha.unwrap_or(0.1); - let mut beta: HashMap = beta_map.unwrap_or_else(HashMap::new); + let mut beta: HashMap = beta_map.unwrap_or_default(); if beta.is_empty() { // beta_map was none diff --git a/src/dag_algo/mod.rs b/src/dag_algo/mod.rs index 489cf2344..04068342d 100644 --- a/src/dag_algo/mod.rs +++ b/src/dag_algo/mod.rs @@ -628,7 +628,6 @@ pub fn collect_bicolor_runs( } } else { for color in colors { - let color = color; ensure_vector_has_index!(pending_list, block_id, color); if let Some(color_block_id) = block_id[color] { block_list[color_block_id].append(&mut pending_list[color]); diff --git a/src/matching/mod.rs b/src/matching/mod.rs index fac47e973..af9740ad9 100644 --- a/src/matching/mod.rs +++ b/src/matching/mod.rs @@ -92,7 +92,7 @@ fn _inner_is_matching(graph: &graph::PyGraph, matching: &HashSet<(usize, usize)> .contains_edge(NodeIndex::new(e.0), NodeIndex::new(e.1)) }; - if !matching.iter().all(|e| has_edge(e)) { + if !matching.iter().all(has_edge) { return false; } let mut found: HashSet = HashSet::with_capacity(2 * matching.len()); diff --git a/src/score.rs b/src/score.rs index 4dc888c5b..95e0d5bea 100644 --- a/src/score.rs +++ b/src/score.rs @@ -10,6 +10,7 @@ // License for the specific language governing permissions and limitations // under the License. #![allow(clippy::derive_partial_eq_without_eq)] +#![allow(clippy::incorrect_partial_ord_impl_on_ord_type)] use std::cmp::Ordering; use std::ops::{Add, AddAssign};