@@ -11,14 +11,14 @@ use std::error::Error;
11
11
use std:: io;
12
12
use time:: { Tm , ParseError } ;
13
13
14
- pub type Response = Result < conduit:: Response , Box < Error +Send > > ;
14
+ pub type Response = Result < conduit:: Response , Box < dyn Error +Send > > ;
15
15
16
16
#[ allow( missing_copy_implementations) ]
17
17
pub struct ConditionalGet ;
18
18
19
19
impl Middleware for ConditionalGet {
20
- fn after ( & self , req : & mut Request , res : Response ) -> Response {
21
- let mut res = try! ( res) ;
20
+ fn after ( & self , req : & mut dyn Request , res : Response ) -> Response {
21
+ let mut res = res? ;
22
22
23
23
match req. method ( ) {
24
24
Method :: Get | Method :: Head => {
@@ -43,7 +43,7 @@ fn is_ok(response: &conduit::Response) -> bool {
43
43
}
44
44
}
45
45
46
- fn is_fresh ( req : & Request , res : & conduit:: Response ) -> bool {
46
+ fn is_fresh ( req : & dyn Request , res : & conduit:: Response ) -> bool {
47
47
let modified_since = req. headers ( ) . find ( "If-Modified-Since" ) . map ( header_val) ;
48
48
let none_match = req. headers ( ) . find ( "If-None-Match" ) . map ( header_val) ;
49
49
@@ -237,7 +237,7 @@ mod tests {
237
237
) ) ) ;
238
238
}
239
239
240
- fn expect_304 ( response : Result < Response , Box < Error +Send > > ) {
240
+ fn expect_304 ( response : Result < Response , Box < dyn Error +Send > > ) {
241
241
let mut response = response. ok ( ) . expect ( "No response" ) ;
242
242
let mut body = Vec :: new ( ) ;
243
243
response. body . write_body ( & mut body) . ok ( ) . expect ( "No body" ) ;
@@ -246,11 +246,11 @@ mod tests {
246
246
assert_eq ! ( body, b"" ) ;
247
247
}
248
248
249
- fn expect_200 ( response : Result < Response , Box < Error +Send > > ) {
249
+ fn expect_200 ( response : Result < Response , Box < dyn Error +Send > > ) {
250
250
expect ( ( 200 , "OK" ) , response) ;
251
251
}
252
252
253
- fn expect ( status : ( u32 , & ' static str ) , response : Result < Response , Box < Error +Send > > ) {
253
+ fn expect ( status : ( u32 , & ' static str ) , response : Result < Response , Box < dyn Error +Send > > ) {
254
254
let mut response = response. ok ( ) . expect ( "No response" ) ;
255
255
let mut body = Vec :: new ( ) ;
256
256
response. body . write_body ( & mut body) . ok ( ) . expect ( "No body" ) ;
@@ -274,7 +274,7 @@ mod tests {
274
274
}
275
275
276
276
impl Handler for SimpleHandler {
277
- fn call ( & self , _: & mut Request ) -> Result < Response , Box < Error +Send > > {
277
+ fn call ( & self , _: & mut dyn Request ) -> Result < Response , Box < dyn Error +Send > > {
278
278
Ok ( Response {
279
279
status : self . status ,
280
280
headers : self . map . clone ( ) ,
0 commit comments