@@ -133,44 +133,3 @@ pub use crate::share::{FlowControl, Ping, PingPong, Pong, RecvStream, SendStream
133133
134134#[ cfg( feature = "unstable" ) ]
135135pub use codec:: { Codec , SendError , UserError } ;
136-
137- use std:: task:: Poll ;
138-
139- // TODO: Get rid of this trait once https://github.com/rust-lang/rust/pull/63512
140- // is stabilized.
141- trait PollExt < T , E > {
142- /// Changes the success value of this `Poll` with the closure provided.
143- fn map_ok_ < U , F > ( self , f : F ) -> Poll < Option < Result < U , E > > >
144- where
145- F : FnOnce ( T ) -> U ;
146- /// Changes the error value of this `Poll` with the closure provided.
147- fn map_err_ < U , F > ( self , f : F ) -> Poll < Option < Result < T , U > > >
148- where
149- F : FnOnce ( E ) -> U ;
150- }
151-
152- impl < T , E > PollExt < T , E > for Poll < Option < Result < T , E > > > {
153- fn map_ok_ < U , F > ( self , f : F ) -> Poll < Option < Result < U , E > > >
154- where
155- F : FnOnce ( T ) -> U ,
156- {
157- match self {
158- Poll :: Ready ( Some ( Ok ( t) ) ) => Poll :: Ready ( Some ( Ok ( f ( t) ) ) ) ,
159- Poll :: Ready ( Some ( Err ( e) ) ) => Poll :: Ready ( Some ( Err ( e) ) ) ,
160- Poll :: Ready ( None ) => Poll :: Ready ( None ) ,
161- Poll :: Pending => Poll :: Pending ,
162- }
163- }
164-
165- fn map_err_ < U , F > ( self , f : F ) -> Poll < Option < Result < T , U > > >
166- where
167- F : FnOnce ( E ) -> U ,
168- {
169- match self {
170- Poll :: Ready ( Some ( Ok ( t) ) ) => Poll :: Ready ( Some ( Ok ( t) ) ) ,
171- Poll :: Ready ( Some ( Err ( e) ) ) => Poll :: Ready ( Some ( Err ( f ( e) ) ) ) ,
172- Poll :: Ready ( None ) => Poll :: Ready ( None ) ,
173- Poll :: Pending => Poll :: Pending ,
174- }
175- }
176- }
0 commit comments