Run cargo clippy --fix (#250)

* Run `cargo clippy --fix`
* Run `cargo clippy --all-features --fix`
* Fix other clippy warnings
* cargo fmt

Co-authored-by: Luis Moreno <morenol@users.noreply.github.com>
This commit is contained in:
morenol
2023-01-27 06:41:18 -04:00
committed by GitHub
parent 83dcf9a8ac
commit c7353d0b57
47 changed files with 146 additions and 222 deletions
+4 -4
View File
@@ -213,17 +213,17 @@ mod tests {
for t in &test_masks[0][0..11] {
// TODO: this can be prob done better
assert_eq!(*t, true)
assert!(*t)
}
for t in &test_masks[0][11..22] {
assert_eq!(*t, false)
assert!(!*t)
}
for t in &test_masks[1][0..11] {
assert_eq!(*t, false)
assert!(!*t)
}
for t in &test_masks[1][11..22] {
assert_eq!(*t, true)
assert!(*t)
}
}
+2 -2
View File
@@ -169,7 +169,7 @@ pub fn train_test_split<
let n_test = ((n as f32) * test_size) as usize;
if n_test < 1 {
panic!("number of sample is too small {}", n);
panic!("number of sample is too small {n}");
}
let mut indices: Vec<usize> = (0..n).collect();
@@ -553,6 +553,6 @@ mod tests {
&accuracy,
)
.unwrap();
println!("{:?}", results);
println!("{results:?}");
}
}