@@ -5,7 +5,7 @@ use std::{
55 fmt,
66 future:: Future ,
77 pin:: Pin ,
8- task:: { ready , Context , Poll } ,
8+ task:: { Context , Poll } ,
99} ;
1010use tower:: { Service , ServiceExt } ;
1111
@@ -146,7 +146,7 @@ where
146146 B :: Error : Into < crate :: BoxError > ,
147147{
148148 type Response = Response < Body > ;
149- type Error = crate :: BoxError ;
149+ type Error = Infallible ;
150150 type Future = RoutesFuture ;
151151
152152 #[ inline]
@@ -168,15 +168,11 @@ impl fmt::Debug for RoutesFuture {
168168}
169169
170170impl Future for RoutesFuture {
171- type Output = Result < Response < Body > , crate :: BoxError > ;
171+ type Output = Result < Response < Body > , Infallible > ;
172172
173173 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) )
181177 }
182178}
0 commit comments