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

Fix newly added clippy warnings #941

Merged
merged 2 commits into from
Dec 16, 2022
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
6 changes: 1 addition & 5 deletions crossbeam-channel/src/flavors/at.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,7 @@ impl Channel {
/// Returns the number of messages in the channel.
#[inline]
pub(crate) fn len(&self) -> usize {
if self.is_empty() {
0
} else {
1
}
usize::from(!self.is_empty())
}

/// Returns the capacity of the channel.
Expand Down
6 changes: 1 addition & 5 deletions crossbeam-channel/src/flavors/tick.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,7 @@ impl Channel {
/// Returns the number of messages in the channel.
#[inline]
pub(crate) fn len(&self) -> usize {
if self.is_empty() {
0
} else {
1
}
usize::from(!self.is_empty())
}

/// Returns the capacity of the channel.
Expand Down
4 changes: 2 additions & 2 deletions crossbeam-skiplist/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1718,7 +1718,7 @@ where
};
match (&next_head, &self.tail) {
// The next key is larger than the latest tail key we observed with this iterator.
(Some(ref next), &Some(ref t)) if next.key() >= t.key() => {
(Some(ref next), Some(t)) if next.key() >= t.key() => {
unsafe {
next.node.decrement(guard);
}
Expand All @@ -1745,7 +1745,7 @@ where
};
match (&self.head, &next_tail) {
// The prev key is smaller than the latest head key we observed with this iterator.
(&Some(ref h), Some(next)) if h.key() >= next.key() => {
(Some(h), Some(next)) if h.key() >= next.key() => {
unsafe {
next.node.decrement(guard);
}
Expand Down