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:
@@ -260,8 +260,8 @@ mod tests_fastpair {
|
||||
let distances = fastpair.distances;
|
||||
let neighbours = fastpair.neighbours;
|
||||
|
||||
assert!(distances.len() != 0);
|
||||
assert!(neighbours.len() != 0);
|
||||
assert!(!distances.is_empty());
|
||||
assert!(!neighbours.is_empty());
|
||||
|
||||
assert_eq!(10, neighbours.len());
|
||||
assert_eq!(10, distances.len());
|
||||
@@ -276,17 +276,13 @@ mod tests_fastpair {
|
||||
// We expect an error when we run `FastPair` on this dataset,
|
||||
// becuase `FastPair` currently only works on a minimum of 3
|
||||
// points.
|
||||
let _fastpair = FastPair::new(&dataset);
|
||||
let fastpair = FastPair::new(&dataset);
|
||||
assert!(fastpair.is_err());
|
||||
|
||||
match _fastpair {
|
||||
Err(e) => {
|
||||
let expected_error =
|
||||
Failed::because(FailedError::FindFailed, "min number of rows should be 3");
|
||||
assert_eq!(e, expected_error)
|
||||
}
|
||||
_ => {
|
||||
assert!(false);
|
||||
}
|
||||
if let Err(e) = fastpair {
|
||||
let expected_error =
|
||||
Failed::because(FailedError::FindFailed, "min number of rows should be 3");
|
||||
assert_eq!(e, expected_error)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -582,7 +578,7 @@ mod tests_fastpair {
|
||||
};
|
||||
for p in dissimilarities.iter() {
|
||||
if p.distance.unwrap() < min_dissimilarity.distance.unwrap() {
|
||||
min_dissimilarity = p.clone()
|
||||
min_dissimilarity = *p
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user