From 16a0df9a678c7a4f6cc3e594bc6fb5e1842251d8 Mon Sep 17 00:00:00 2001 From: Joey Beauvais-Feisthauer Date: Mon, 6 Feb 2023 20:07:11 -0500 Subject: [PATCH] Fix `clippy::useless_conversion` --- ext/crates/once/src/lib.rs | 2 +- ext/src/chain_complex/chain_homotopy.rs | 2 +- ext/src/resolution_homomorphism.rs | 5 +---- ext/src/secondary.rs | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/ext/crates/once/src/lib.rs b/ext/crates/once/src/lib.rs index d03826250..95dbc23f6 100644 --- a/ext/crates/once/src/lib.rs +++ b/ext/crates/once/src/lib.rs @@ -571,7 +571,7 @@ impl OnceVec { inner_index(len - 1).0 + 1 }; - (0..page_end).into_iter().flat_map(move |page| unsafe { + (0..page_end).flat_map(move |page| unsafe { // Safety: tautological self.page(page).as_slice(len, page) }) diff --git a/ext/src/chain_complex/chain_homotopy.rs b/ext/src/chain_complex/chain_homotopy.rs index fcbf712e6..687f7064a 100644 --- a/ext/src/chain_complex/chain_homotopy.rs +++ b/ext/src/chain_complex/chain_homotopy.rs @@ -269,7 +269,7 @@ impl< }; #[cfg(not(feature = "concurrent"))] - let scratches: Vec = (0..num_gens).into_iter().map(f).collect(); + let scratches: Vec = (0..num_gens).map(f).collect(); #[cfg(feature = "concurrent")] let scratches: Vec = (0..num_gens).into_par_iter().map(f).collect(); diff --git a/ext/src/resolution_homomorphism.rs b/ext/src/resolution_homomorphism.rs index eb5e7f589..3c3153599 100644 --- a/ext/src/resolution_homomorphism.rs +++ b/ext/src/resolution_homomorphism.rs @@ -305,10 +305,7 @@ where }; #[cfg(not(feature = "concurrent"))] - let fdx_vectors: Vec = (0..num_gens) - .into_iter() - .filter_map(compute_fdx_vector) - .collect(); + let fdx_vectors: Vec = (0..num_gens).filter_map(compute_fdx_vector).collect(); #[cfg(feature = "concurrent")] let fdx_vectors: Vec = (0..num_gens) diff --git a/ext/src/secondary.rs b/ext/src/secondary.rs index aad9c94e9..2c412240a 100644 --- a/ext/src/secondary.rs +++ b/ext/src/secondary.rs @@ -593,8 +593,7 @@ pub trait SecondaryLift: Sync { .collect(); #[cfg(not(feature = "concurrent"))] - let mut intermediates: Vec = - (0..num_gens).into_iter().map(get_intermediate).collect(); + let mut intermediates: Vec = (0..num_gens).map(get_intermediate).collect(); let mut results = vec![FpVector::new(p, target_dim); num_gens];