File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 1
1
// Take a look at the license at the top of the repository in the LICENSE file.
2
2
3
- use std:: num:: NonZeroU64 ;
3
+ use std:: { future :: IntoFuture , num:: NonZeroU64 } ;
4
4
5
5
use futures_channel:: oneshot;
6
6
use futures_core:: Future ;
@@ -146,6 +146,26 @@ pub trait CancellableExtManual: IsA<Cancellable> {
146
146
147
147
impl < O : IsA < Cancellable > > CancellableExtManual for O { }
148
148
149
+ impl IntoFuture for Cancellable {
150
+ type Output = ( ) ;
151
+
152
+ type IntoFuture = std:: pin:: Pin < Box < dyn Future < Output = ( ) > + Send + Sync + ' static > > ;
153
+
154
+ fn into_future ( self ) -> Self :: IntoFuture {
155
+ self . future ( )
156
+ }
157
+ }
158
+
159
+ impl IntoFuture for & Cancellable {
160
+ type Output = ( ) ;
161
+
162
+ type IntoFuture = std:: pin:: Pin < Box < dyn Future < Output = ( ) > + Send + Sync + ' static > > ;
163
+
164
+ fn into_future ( self ) -> Self :: IntoFuture {
165
+ self . future ( )
166
+ }
167
+ }
168
+
149
169
#[ cfg( test) ]
150
170
mod tests {
151
171
use super :: * ;
You can’t perform that action at this time.
0 commit comments