Skip to content

Commit c3d2637

Browse files
committed
fix: optimized Drop trait
1 parent d86ab7f commit c3d2637

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/cron.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,10 @@ where
161161
}
162162
}
163163

164-
impl<'a, D> Drop for Cron<'a, D>
164+
impl<D> Drop for Cron<'_, D>
165165
where
166166
D: Driver + Send + Sync,
167167
{
168-
#[allow(unused_must_use)]
169168
fn drop(&mut self) {
170169
self.node_pool.stop();
171170
}

src/node_pool.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use std::sync::Arc;
21
use std::sync::atomic::{AtomicBool, AtomicU8};
2+
use std::sync::Arc;
33

44
use thiserror::Error;
55
use tokio::sync::RwLock;
@@ -116,7 +116,7 @@ where
116116
}
117117
}
118118

119-
pub async fn stop(&self) {
119+
pub fn stop(&self) {
120120
self.stop.store(true, std::sync::atomic::Ordering::SeqCst);
121121
}
122122
}
@@ -125,7 +125,6 @@ impl<D> Drop for NodePool<D>
125125
where
126126
D: Driver + Send + Sync,
127127
{
128-
#[allow(unused_must_use)]
129128
fn drop(&mut self) {
130129
self.stop();
131130
}

0 commit comments

Comments
 (0)