Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
donjuanplatinum committed Jun 9, 2024
1 parent af9cdda commit fcf86b8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/sorting/bubble_sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
/// ```
pub fn bubble_sort<T>(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);
}
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/sorting/mod.rs
Original file line number Diff line number Diff line change
@@ -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::*;

0 comments on commit fcf86b8

Please sign in to comment.