@@ -5,7 +5,7 @@ use std::{
5
5
fmt,
6
6
future:: Future ,
7
7
pin:: Pin ,
8
- task:: { ready , Context , Poll } ,
8
+ task:: { Context , Poll } ,
9
9
} ;
10
10
use tower:: { Service , ServiceExt } ;
11
11
@@ -146,7 +146,7 @@ where
146
146
B :: Error : Into < crate :: BoxError > ,
147
147
{
148
148
type Response = Response < Body > ;
149
- type Error = crate :: BoxError ;
149
+ type Error = Infallible ;
150
150
type Future = RoutesFuture ;
151
151
152
152
#[ inline]
@@ -168,15 +168,11 @@ impl fmt::Debug for RoutesFuture {
168
168
}
169
169
170
170
impl Future for RoutesFuture {
171
- type Output = Result < Response < Body > , crate :: BoxError > ;
171
+ type Output = Result < Response < Body > , Infallible > ;
172
172
173
173
fn poll ( mut self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < Self :: Output > {
174
- match ready ! ( Pin :: new( & mut self . as_mut( ) . 0 ) . poll( cx) ) {
175
- Ok ( res) => Ok ( res. map ( Body :: new) ) . into ( ) ,
176
- // NOTE: This pattern is not needed from Rust 1.82.
177
- // See https://github.com/rust-lang/rust/pull/122792.
178
- #[ allow( unreachable_patterns) ]
179
- Err ( err) => match err { } ,
180
- }
174
+ Pin :: new ( & mut self . as_mut ( ) . 0 )
175
+ . poll ( cx)
176
+ . map_ok ( |res| res. map ( Body :: new) )
181
177
}
182
178
}
0 commit comments