ci: enable clippy lints (#1335)

This commit is contained in:
Taiki Endo
2019-07-26 03:47:14 +09:00
committed by GitHub
parent f311ac3d4f
commit fe021e6c00
54 changed files with 394 additions and 274 deletions
+6 -6
View File
@@ -393,7 +393,7 @@ impl State {
State((capacity << NUM_SHIFT) | NUM_FLAG)
}
fn remaining_capacity(&self) -> usize {
fn remaining_capacity(self) -> usize {
if !self.has_remaining_capacity() {
return 0;
}
@@ -401,15 +401,15 @@ impl State {
self.0 >> 1
}
fn has_remaining_capacity(&self) -> bool {
fn has_remaining_capacity(self) -> bool {
self.0 & NUM_FLAG == NUM_FLAG
}
fn has_task(&self, stub: &Task) -> bool {
fn has_task(self, stub: &Task) -> bool {
!(self.has_remaining_capacity() || self.is_stub(stub))
}
fn is_stub(&self, stub: &Task) -> bool {
fn is_stub(self, stub: &Task) -> bool {
self.0 == stub as *const _ as usize
}
@@ -452,11 +452,11 @@ impl State {
}
}
fn is_ptr(&self) -> bool {
fn is_ptr(self) -> bool {
self.0 & NUM_FLAG == 0
}
fn ptr(&self) -> Option<*const Task> {
fn ptr(self) -> Option<*const Task> {
if self.is_ptr() {
Some(self.0 as *const Task)
} else {