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 11// Take a look at the license at the top of the repository in the LICENSE file.
22
3- use std:: num:: NonZeroU64 ;
3+ use std:: { future :: IntoFuture , num:: NonZeroU64 } ;
44
55use futures_channel:: oneshot;
66use futures_core:: Future ;
@@ -146,6 +146,26 @@ pub trait CancellableExtManual: IsA<Cancellable> {
146146
147147impl < O : IsA < Cancellable > > CancellableExtManual for O { }
148148
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+
149169#[ cfg( test) ]
150170mod tests {
151171 use super :: * ;
You can’t perform that action at this time.
0 commit comments