Skip to content

Commit

Permalink
clippy: use sort_unstable().
Browse files Browse the repository at this point in the history
  • Loading branch information
tolikzinovyev committed Jan 6, 2025
1 parent cf28270 commit c70307e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/simple_lottery/algorithm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub(super) fn prove(setup: &Setup, prover_set: &[Element]) -> Option<Proof> {
element_sequence.push(element);
}
if prover_set.len() as u64 >= setup.proof_size {
element_sequence.sort();
element_sequence.sort_unstable();
return Some(Proof { element_sequence });
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ use super::types::Element;
/// Returns true iff all elements in the slice are distinct.
pub(crate) fn check_distinct(elements: &[Element]) -> bool {
let mut elements = elements.to_vec();
elements.sort();
elements.sort_unstable();
elements.is_sorted_by(|a, b| a < b)
}

0 comments on commit c70307e

Please sign in to comment.