Skip to content

Commit

Permalink
Fix build errors with Rust 1.73.0 (#996)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mtreinish authored Oct 5, 2023
1 parent 5ab599f commit 651409f
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rustworkx-core/src/centrality.rs
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ where
{
let alpha: f64 = alpha.unwrap_or(0.1);

let mut beta: HashMap<usize, f64> = beta_map.unwrap_or_else(HashMap::new);
let mut beta: HashMap<usize, f64> = beta_map.unwrap_or_default();

if beta.is_empty() {
// beta_map was none
Expand Down
1 change: 0 additions & 1 deletion src/dag_algo/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
2 changes: 1 addition & 1 deletion src/matching/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<usize> = HashSet::with_capacity(2 * matching.len());
Expand Down
1 change: 1 addition & 0 deletions src/score.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down

0 comments on commit 651409f

Please sign in to comment.