mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-25 00:00:18 +02:00
ci: enable clippy lints (#1335)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user