File tree Expand file tree Collapse file tree 1 file changed +5
-18
lines changed Expand file tree Collapse file tree 1 file changed +5
-18
lines changed Original file line number Diff line number Diff line change @@ -28,29 +28,22 @@ mod watch;
28
28
pub struct CompioRuntime ;
29
29
30
30
#[ derive( Debug ) ]
31
- pub struct CompioJoinError ( pub Box < dyn Any + Send > ) ;
31
+ pub struct CompioJoinError ( Box < dyn Any + Send > ) ;
32
32
33
33
impl Display for CompioJoinError {
34
34
fn fmt ( & self , f : & mut Formatter < ' _ > ) -> Result < ( ) , Error > {
35
35
write ! ( f, "Spawned task panicked" )
36
36
}
37
37
}
38
38
39
- pub struct CompioJoinHandle < T > ( pub Option < compio:: runtime:: JoinHandle < T > > ) ;
40
-
41
- impl < T > CompioJoinHandle < T > {
42
- pub fn cancel ( mut self ) {
43
- if let Some ( task) = self . 0 . take ( ) {
44
- task. cancel ( ) ;
45
- }
46
- }
47
- }
39
+ pub struct CompioJoinHandle < T > ( Option < compio:: runtime:: JoinHandle < T > > ) ;
48
40
49
41
impl < T > Drop for CompioJoinHandle < T > {
50
42
fn drop ( & mut self ) {
51
- if let Some ( task ) = self . 0 . take ( ) {
52
- task . detach ( ) ;
43
+ let Some ( j ) = self . 0 . take ( ) else {
44
+ return ;
53
45
}
46
+ j. detach ( ) ;
54
47
}
55
48
}
56
49
@@ -68,12 +61,6 @@ impl<T> Future for CompioJoinHandle<T> {
68
61
}
69
62
}
70
63
71
- impl < T > FusedFuture for CompioJoinHandle < T > {
72
- fn is_terminated ( & self ) -> bool {
73
- self . 0 . is_none ( )
74
- }
75
- }
76
-
77
64
pub type BoxedFuture < T > = Pin < Box < dyn Future < Output = T > > > ;
78
65
79
66
pin_project_lite:: pin_project! {
You can’t perform that action at this time.
0 commit comments