mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-28 00:00:11 +02:00
ci: enable clippy lints (#1335)
This commit is contained in:
@@ -622,7 +622,7 @@ impl Worker {
|
||||
|
||||
// We obtained permission to push the worker into the
|
||||
// sleeper queue.
|
||||
if let Err(_) = self.pool.push_sleeper(self.id.0) {
|
||||
if self.pool.push_sleeper(self.id.0).is_err() {
|
||||
trace!(" sleeping -- push to stack failed; idx={}", self.id.0);
|
||||
// The push failed due to the pool being terminated.
|
||||
//
|
||||
|
||||
@@ -120,10 +120,7 @@ impl Stack {
|
||||
terminate: bool,
|
||||
) -> Option<(usize, worker::State)> {
|
||||
// Figure out the empty value
|
||||
let terminal = match terminate {
|
||||
true => TERMINATED,
|
||||
false => EMPTY,
|
||||
};
|
||||
let terminal = if terminate { TERMINATED } else { EMPTY };
|
||||
|
||||
// If terminating, the max lifecycle *must* be `Signaled`, which is the
|
||||
// highest lifecycle. By passing the greatest possible lifecycle value,
|
||||
@@ -215,7 +212,7 @@ impl State {
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn head(&self) -> usize {
|
||||
fn head(self) -> usize {
|
||||
self.0 & STACK_MASK
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ pub(crate) enum Lifecycle {
|
||||
|
||||
impl State {
|
||||
/// Returns true if the worker entry is pushed in the sleeper stack
|
||||
pub fn is_pushed(&self) -> bool {
|
||||
pub fn is_pushed(self) -> bool {
|
||||
self.0 & PUSHED_MASK == PUSHED_MASK
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ impl State {
|
||||
self.0 |= PUSHED_MASK
|
||||
}
|
||||
|
||||
pub fn is_notified(&self) -> bool {
|
||||
pub fn is_notified(self) -> bool {
|
||||
use self::Lifecycle::*;
|
||||
|
||||
match self.lifecycle() {
|
||||
@@ -52,7 +52,7 @@ impl State {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn lifecycle(&self) -> Lifecycle {
|
||||
pub fn lifecycle(self) -> Lifecycle {
|
||||
Lifecycle::from(self.0 & LIFECYCLE_MASK)
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ impl State {
|
||||
self.0 = (self.0 & !LIFECYCLE_MASK) | (val as usize)
|
||||
}
|
||||
|
||||
pub fn is_signaled(&self) -> bool {
|
||||
pub fn is_signaled(self) -> bool {
|
||||
self.lifecycle() == Lifecycle::Signaled
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user