From fcf86b8783e3e45585716e86fc58f79359d4ffc0 Mon Sep 17 00:00:00 2001 From: donjuanplatinum Date: Sun, 9 Jun 2024 13:29:46 -0400 Subject: [PATCH] fmt --- src/sorting/bubble_sort.rs | 10 +++++----- src/sorting/mod.rs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/sorting/bubble_sort.rs b/src/sorting/bubble_sort.rs index 656cba3..5f75cc2 100644 --- a/src/sorting/bubble_sort.rs +++ b/src/sorting/bubble_sort.rs @@ -8,11 +8,11 @@ /// ``` pub fn bubble_sort(array: &mut [T], comparator: fn(&T, &T) -> bool) -> () { for point in (0..array.len()).rev() { - for current_point in 0..point { - if !comparator(&array[current_point],&array[current_point+1]) { - array.swap(current_point,current_point + 1); - } - } + for current_point in 0..point { + if !comparator(&array[current_point], &array[current_point + 1]) { + array.swap(current_point, current_point + 1); + } + } } } diff --git a/src/sorting/mod.rs b/src/sorting/mod.rs index 9f995ee..be87aec 100644 --- a/src/sorting/mod.rs +++ b/src/sorting/mod.rs @@ -1,9 +1,9 @@ +mod bubble_sort; mod insertion_sort; mod selection_sort; mod utils; -mod bubble_sort; +pub use self::bubble_sort::*; pub use self::insertion_sort::*; pub use self::selection_sort::*; pub use self::utils::*; -pub use self::bubble_sort::*;