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
+1 -1
View File
@@ -115,7 +115,7 @@ impl Iterator for AtomicStackEntries {
impl Drop for AtomicStackEntries {
fn drop(&mut self) {
while let Some(entry) = self.next() {
for entry in self {
// Flag the entry as errored
entry.error();
}
+3 -2
View File
@@ -125,8 +125,9 @@ impl Entry {
}
/// Only called by `Registration`
pub fn time_mut(&self) -> &mut Time {
unsafe { &mut *self.time.get() }
#[allow(clippy::mut_from_ref)] // https://github.com/rust-lang/rust-clippy/issues/4281
pub unsafe fn time_mut(&self) -> &mut Time {
&mut *self.time.get()
}
/// Returns `true` if the `Entry` is currently associated with a timer
+6 -2
View File
@@ -38,7 +38,9 @@ impl Registration {
}
pub fn reset(&mut self, deadline: Instant) {
self.entry.time_mut().deadline = deadline;
unsafe {
self.entry.time_mut().deadline = deadline;
}
Entry::reset(&mut self.entry);
}
@@ -46,7 +48,9 @@ impl Registration {
#[cfg(feature = "async-traits")]
pub fn reset_timeout(&mut self) {
let deadline = crate::clock::now() + self.entry.time_ref().duration;
self.entry.time_mut().deadline = deadline;
unsafe {
self.entry.time_mut().deadline = deadline;
}
Entry::reset(&mut self.entry);
}