Skip to content

Commit

Permalink
cargo clippy --fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LLFourn committed Jan 29, 2025
1 parent 4c8dc9b commit 23250f1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/bnb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ struct Branch<'a> {
is_exclusion: bool,
}

impl<'a> Ord for Branch<'a> {
impl Ord for Branch<'_> {
fn cmp(&self, other: &Self) -> core::cmp::Ordering {
// NOTE: Reverse comparision `lower_bound` because we want a min-heap (by default BinaryHeap
// is a max-heap).
Expand All @@ -181,19 +181,19 @@ impl<'a> Ord for Branch<'a> {
}
}

impl<'a> PartialOrd for Branch<'a> {
impl PartialOrd for Branch<'_> {
fn partial_cmp(&self, other: &Self) -> Option<core::cmp::Ordering> {
Some(self.cmp(other))
}
}

impl<'a> PartialEq for Branch<'a> {
impl PartialEq for Branch<'_> {
fn eq(&self, other: &Self) -> bool {
self.lower_bound == other.lower_bound
}
}

impl<'a> Eq for Branch<'a> {}
impl Eq for Branch<'_> {}

/// A branch and bound metric where we minimize the [`Ordf32`] score.
///
Expand Down
4 changes: 2 additions & 2 deletions src/coin_selector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ impl<'a> CoinSelector<'a> {
}
}

impl<'a> core::fmt::Display for CoinSelector<'a> {
impl core::fmt::Display for CoinSelector<'_> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "[")?;
let mut candidates = self.candidates().peekable();
Expand Down Expand Up @@ -619,7 +619,7 @@ impl<'a> Iterator for SelectIter<'a> {
}
}

impl<'a> DoubleEndedIterator for SelectIter<'a> {
impl DoubleEndedIterator for SelectIter<'_> {
fn next_back(&mut self) -> Option<Self::Item> {
let (index, wv) = self.cs.unselected().next_back()?;
self.cs.select(index);
Expand Down

0 comments on commit 23250f1

Please sign in to comment.