Skip to content

Commit

Permalink
Merge branch 'master' of github.com:actix/actix-web
Browse files Browse the repository at this point in the history
  • Loading branch information
fafhrd91 committed Dec 16, 2019
2 parents 01613f3 + 30dcaf9 commit 29ac646
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
6 changes: 1 addition & 5 deletions actix-http/src/cookie/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,7 @@ impl From<Utf8Error> for ParseError {
}
}

impl Error for ParseError {
fn description(&self) -> &str {
self.as_str()
}
}
impl Error for ParseError {}

fn indexes_of(needle: &str, haystack: &str) -> Option<(usize, usize)> {
let haystack_start = haystack.as_ptr() as usize;
Expand Down
11 changes: 3 additions & 8 deletions actix-http/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ impl fmt::Debug for Error {
}

impl std::error::Error for Error {
fn description(&self) -> &str {
"actix-http::Error"
}

fn cause(&self) -> Option<&dyn std::error::Error> {
None
}
Expand Down Expand Up @@ -966,7 +962,6 @@ mod tests {
use super::*;
use http::{Error as HttpError, StatusCode};
use httparse;
use std::error::Error as StdError;
use std::io;

#[test]
Expand Down Expand Up @@ -995,15 +990,15 @@ mod tests {
#[test]
fn test_error_cause() {
let orig = io::Error::new(io::ErrorKind::Other, "other");
let desc = orig.description().to_owned();
let desc = orig.to_string();
let e = Error::from(orig);
assert_eq!(format!("{}", e.as_response_error()), desc);
}

#[test]
fn test_error_display() {
let orig = io::Error::new(io::ErrorKind::Other, "other");
let desc = orig.description().to_owned();
let desc = orig.to_string();
let e = Error::from(orig);
assert_eq!(format!("{}", e), desc);
}
Expand Down Expand Up @@ -1045,7 +1040,7 @@ mod tests {
match ParseError::from($from) {
e @ $error => {
let desc = format!("{}", e);
assert_eq!(desc, format!("IO error: {}", $from.description()));
assert_eq!(desc, format!("IO error: {}", $from));
}
_ => unreachable!("{:?}", $from),
}
Expand Down

0 comments on commit 29ac646

Please sign in to comment.