fix cancellable future
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
8a1028e0e7
commit
b5c9a706ce
@ -61,7 +61,9 @@ impl Canceller {
|
||||
///
|
||||
/// This does nothing if the future already finished successfully.
|
||||
pub fn cancel(&self) {
|
||||
let _ = self.0.lock().unwrap().take().unwrap().send(());
|
||||
if let Some(sender) = self.0.lock().unwrap().take() {
|
||||
let _ = sender.send(());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user