chore: format
This commit is contained in:
parent
4e3849a76d
commit
d75c103ae7
1 changed files with 3 additions and 4 deletions
|
@ -1,8 +1,7 @@
|
|||
#[cfg(test)]
|
||||
use crate::*;
|
||||
use std::hash::{BuildHasher, Hasher, RandomState};
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
/// Tests what stdout prints
|
||||
#[test]
|
||||
fn stdout_content() {
|
||||
|
@ -69,7 +68,7 @@ fn test_output_is_sorted_sort_works() {
|
|||
}
|
||||
|
||||
// https://stackoverflow.com/a/78840539/16432246
|
||||
// with rand::seq::SliceRandom and you can shuffle a Vec, but doing this to avoid introducing a ton of dependencies for one little test
|
||||
// with rand::seq::SliceRandom you can shuffle a Vec, but doing this to avoid introducing a ton of dependencies for one little test
|
||||
fn shuffle_vec<T>(vec: &mut [T]) {
|
||||
let n: usize = vec.len();
|
||||
for i in 0..(n - 1) {
|
||||
|
@ -78,4 +77,4 @@ fn shuffle_vec<T>(vec: &mut [T]) {
|
|||
let j = (RandomState::new().build_hasher().finish() as usize) % (n - i) + i;
|
||||
vec.swap(i, j);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue