Skip to content

Commit

Permalink
修改selection_sort和utils的泛型签名
Browse files Browse the repository at this point in the history
  • Loading branch information
donjuanplatinum committed Jun 9, 2024
1 parent a656120 commit add7e4c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/sorting/selection_sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
/// is_sorted(&mut a,|a,b| a<=b);
/// ```
pub fn selection_sort<T>(array: &mut [T], comparator: fn(&T, &T) -> bool) -> ()
where
T: PartialOrd,
{
for point in 0..array.len() {
let mut better: usize = point;
Expand Down
2 changes: 0 additions & 2 deletions src/sorting/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
/// assert_eq!(is_sorted(&mut a,|a,b|a<=b),true);
/// ```
pub fn is_sorted<'a, T>(array: &'a [T], compare: fn(&T, &T) -> bool) -> bool
where
T: PartialOrd + 'a,
{
if array.len() == 0 {
return true;
Expand Down

0 comments on commit add7e4c

Please sign in to comment.