Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo clippy --fix #33

Merged
merged 1 commit into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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