Skip to content

Commit 0f6ca53

Browse files
committed
fix deepsource issues on shutdown.rs
1 parent 12f0358 commit 0f6ca53

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

src/connectors/common/shutdown.rs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,6 @@ pub struct Shutdown {
2828
}
2929

3030
impl Shutdown {
31-
pub fn new() -> Self {
32-
let cancel_token = CancellationToken::new();
33-
let (shutdown_complete_tx, shutdown_complete_rx) = mpsc::channel(1);
34-
Self {
35-
cancel_token,
36-
shutdown_complete_tx,
37-
shutdown_complete_rx: Some(shutdown_complete_rx),
38-
}
39-
}
40-
4131
pub fn start(&self) {
4232
self.cancel_token.cancel();
4333
}
@@ -72,7 +62,13 @@ impl Shutdown {
7262

7363
impl Default for Shutdown {
7464
fn default() -> Self {
75-
Shutdown::new()
65+
let cancel_token = CancellationToken::new();
66+
let (shutdown_complete_tx, shutdown_complete_rx) = mpsc::channel(1);
67+
Self {
68+
cancel_token,
69+
shutdown_complete_tx,
70+
shutdown_complete_rx: Some(shutdown_complete_rx),
71+
}
7672
}
7773
}
7874

0 commit comments

Comments
 (0)