Skip to content

Commit 88b9409

Browse files
Merge pull request #2 from jtgeibel/fix-warnings
Fix warnings
2 parents 98f4943 + 8b5d5d0 commit 88b9409

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/lib.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ use std::error::Error;
1111
use std::io;
1212
use time::{Tm, ParseError};
1313

14-
pub type Response = Result<conduit::Response, Box<Error+Send>>;
14+
pub type Response = Result<conduit::Response, Box<dyn Error+Send>>;
1515

1616
#[allow(missing_copy_implementations)]
1717
pub struct ConditionalGet;
1818

1919
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?;
2222

2323
match req.method() {
2424
Method::Get | Method::Head => {
@@ -43,7 +43,7 @@ fn is_ok(response: &conduit::Response) -> bool {
4343
}
4444
}
4545

46-
fn is_fresh(req: &Request, res: &conduit::Response) -> bool {
46+
fn is_fresh(req: &dyn Request, res: &conduit::Response) -> bool {
4747
let modified_since = req.headers().find("If-Modified-Since").map(header_val);
4848
let none_match = req.headers().find("If-None-Match").map(header_val);
4949

@@ -237,7 +237,7 @@ mod tests {
237237
)));
238238
}
239239

240-
fn expect_304(response: Result<Response, Box<Error+Send>>) {
240+
fn expect_304(response: Result<Response, Box<dyn Error+Send>>) {
241241
let mut response = response.ok().expect("No response");
242242
let mut body = Vec::new();
243243
response.body.write_body(&mut body).ok().expect("No body");
@@ -246,11 +246,11 @@ mod tests {
246246
assert_eq!(body, b"");
247247
}
248248

249-
fn expect_200(response: Result<Response, Box<Error+Send>>) {
249+
fn expect_200(response: Result<Response, Box<dyn Error+Send>>) {
250250
expect((200, "OK"), response);
251251
}
252252

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>>) {
254254
let mut response = response.ok().expect("No response");
255255
let mut body = Vec::new();
256256
response.body.write_body(&mut body).ok().expect("No body");
@@ -274,7 +274,7 @@ mod tests {
274274
}
275275

276276
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>> {
278278
Ok(Response {
279279
status: self.status,
280280
headers: self.map.clone(),

0 commit comments

Comments
 (0)