mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-22 05:28:42 +00:00
Impl Deref{Mut}
for AutoAbortJoinHandle
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
d6a372a160
commit
52210d1a8c
1 changed files with 15 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
use std::{
|
||||
fs,
|
||||
io::{self, stderr, stdin, Write},
|
||||
ops::{Deref, DerefMut},
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
|
||||
|
@ -311,3 +312,17 @@ impl<T> Drop for AutoAbortJoinHandle<T> {
|
|||
self.0.abort();
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Deref for AutoAbortJoinHandle<T> {
|
||||
type Target = task::JoinHandle<T>;
|
||||
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> DerefMut for AutoAbortJoinHandle<T> {
|
||||
fn deref_mut(&mut self) -> &mut Self::Target {
|
||||
&mut self.0
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue