Skip to content

Commit b75964c

Browse files
committed
Use sort_unstable on primitive types
Clippy emits a few warnings of type: warning: used `sort` on primitive type `u32` As suggested, use `sort_unstable` on `u32` and `usize` primitives.
1 parent 769cd6d commit b75964c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/policy/semantic.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ impl<Pk: MiniscriptKey> Policy<Pk> {
489489
/// which appear in the policy
490490
pub fn relative_timelocks(&self) -> Vec<u32> {
491491
let mut ret = self.real_relative_timelocks();
492-
ret.sort();
492+
ret.sort_unstable();
493493
ret.dedup();
494494
ret
495495
}
@@ -517,7 +517,7 @@ impl<Pk: MiniscriptKey> Policy<Pk> {
517517
/// which appear in the policy
518518
pub fn absolute_timelocks(&self) -> Vec<u32> {
519519
let mut ret = self.real_absolute_timelocks();
520-
ret.sort();
520+
ret.sort_unstable();
521521
ret.dedup();
522522
ret
523523
}
@@ -597,7 +597,7 @@ impl<Pk: MiniscriptKey> Policy<Pk> {
597597
// Not enough branches are satisfiable
598598
None
599599
} else {
600-
sublens.sort();
600+
sublens.sort_unstable();
601601
Some(sublens[0..k].iter().cloned().sum::<usize>())
602602
}
603603
}

0 commit comments

Comments
 (0)