diff --git a/Cargo.toml b/Cargo.toml index ad29212e814..12e6fed2e2c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -160,7 +160,6 @@ imprecise_flops = { level = "allow", priority = 1 } missing_const_for_fn = { level = "allow", priority = 1 } nonstandard_macro_braces = { level = "allow", priority = 1 } option_if_let_else = { level = "allow", priority = 1 } -redundant_clone = { level = "allow", priority = 1 } suboptimal_flops = { level = "allow", priority = 1 } suspicious_operation_groupings = { level = "allow", priority = 1 } use_self = { level = "allow", priority = 1 } diff --git a/src/graph/decremental_connectivity.rs b/src/graph/decremental_connectivity.rs index 08d853d80ef..e5245404866 100644 --- a/src/graph/decremental_connectivity.rs +++ b/src/graph/decremental_connectivity.rs @@ -224,7 +224,7 @@ mod tests { HashSet::from([7, 8]), HashSet::from([7]), ]; - let mut dec_con = super::DecrementalConnectivity::new(adjacent.clone()).unwrap(); + let mut dec_con = super::DecrementalConnectivity::new(adjacent).unwrap(); dec_con.delete(2, 4); } @@ -260,7 +260,7 @@ mod tests { dec_con2.delete(4, 1); assert!(!dec_con2.connected(1, 4).unwrap()); - let mut dec_con3 = super::DecrementalConnectivity::new(adjacent.clone()).unwrap(); + let mut dec_con3 = super::DecrementalConnectivity::new(adjacent).unwrap(); dec_con3.delete(1, 4); assert!(!dec_con3.connected(4, 1).unwrap()); } diff --git a/src/machine_learning/cholesky.rs b/src/machine_learning/cholesky.rs index 3d4f392e8ad..23be6b6ad7a 100644 --- a/src/machine_learning/cholesky.rs +++ b/src/machine_learning/cholesky.rs @@ -38,7 +38,7 @@ mod tests { fn test_cholesky() { // Test case 1 let mat1 = vec![25.0, 15.0, -5.0, 15.0, 18.0, 0.0, -5.0, 0.0, 11.0]; - let res1 = cholesky(mat1.clone(), 3); + let res1 = cholesky(mat1, 3); // The expected Cholesky decomposition values #[allow(clippy::useless_vec)] @@ -92,7 +92,7 @@ mod tests { #[test] fn matrix_with_all_zeros() { let mat3 = vec![0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]; - let res3 = cholesky(mat3.clone(), 3); + let res3 = cholesky(mat3, 3); let expected3 = vec![0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]; assert_eq!(res3, expected3); } diff --git a/src/math/softmax.rs b/src/math/softmax.rs index f0338cb296c..582bf452ef5 100644 --- a/src/math/softmax.rs +++ b/src/math/softmax.rs @@ -20,7 +20,7 @@ use std::f32::consts::E; pub fn softmax(array: Vec) -> Vec { - let mut softmax_array = array.clone(); + let mut softmax_array = array; for value in &mut softmax_array { *value = E.powf(*value);