diff --git a/src/main.rs b/src/main.rs index 302798a..c41c631 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,12 +1,12 @@ mod bst; -mod stack; mod sort; +mod stack; +use bst::BinarySearchTree; use clap::{Args, Parser, Subcommand}; use rand::Rng; -use bst::BinarySearchTree; -use stack::Stack; use sort::bucket_sort; +use stack::Stack; #[derive(Parser, Debug)] struct Cli { diff --git a/src/sort.rs b/src/sort.rs index 3c26552..6624e47 100644 --- a/src/sort.rs +++ b/src/sort.rs @@ -4,7 +4,10 @@ pub fn bucket_sort(to_sort: &[T; SIZ // sort into buckets let mut buckets = BTreeMap::new(); for item in to_sort { - buckets.entry(item).and_modify(|count| *count += 1).or_insert(1); + buckets + .entry(item) + .and_modify(|count| *count += 1) + .or_insert(1); } // Create new array, copying items to new array @@ -19,4 +22,4 @@ pub fn bucket_sort(to_sort: &[T; SIZ } } result -} \ No newline at end of file +}