1
- #![ feature( core) ]
2
1
#![ cfg_attr( test, feature( io) ) ]
3
2
4
3
extern crate conduit;
@@ -68,7 +67,7 @@ impl Handler for MiddlewareBuilder {
68
67
} ,
69
68
None => {
70
69
let res = { self . handler . as_ref ( ) . unwrap ( ) . call ( req) } ;
71
- let middlewares = self . middlewares . as_slice ( ) ;
70
+ let middlewares = & self . middlewares ;
72
71
73
72
run_afters ( middlewares, req, res)
74
73
}
@@ -90,6 +89,7 @@ mod tests {
90
89
91
90
use { MiddlewareBuilder , Middleware , AroundMiddleware } ;
92
91
92
+ use std:: any:: Any ;
93
93
use std:: collections:: HashMap ;
94
94
use std:: error:: Error ;
95
95
use std:: io:: { self , Cursor } ;
@@ -123,9 +123,7 @@ mod tests {
123
123
fn scheme ( & self ) -> Scheme { unimplemented ! ( ) }
124
124
fn host < ' a > ( & ' a self ) -> Host < ' a > { unimplemented ! ( ) }
125
125
fn virtual_root < ' a > ( & ' a self ) -> Option < & ' a str > { unimplemented ! ( ) }
126
- fn path < ' a > ( & ' a self ) -> & ' a str {
127
- self . path . as_slice ( )
128
- }
126
+ fn path < ' a > ( & ' a self ) -> & ' a str { & self . path }
129
127
fn query_string < ' a > ( & ' a self ) -> Option < & ' a str > { unimplemented ! ( ) }
130
128
fn remote_addr ( & self ) -> SocketAddr { unimplemented ! ( ) }
131
129
fn content_length ( & self ) -> Option < u64 > { unimplemented ! ( ) }
@@ -212,7 +210,7 @@ mod tests {
212
210
}
213
211
}
214
212
215
- fn get_extension < ' a , T : ' static > ( req : & ' a Request ) -> & ' a T {
213
+ fn get_extension < ' a , T : Any > ( req : & ' a Request ) -> & ' a T {
216
214
req. extensions ( ) . find :: < T > ( ) . unwrap ( )
217
215
}
218
216
0 commit comments