mirror of
https://github.com/actix/actix-extras.git
synced 2025-01-22 14:55:56 +01:00
Remove description()
(#19)
* Remove `description()` It has been deprecated.
This commit is contained in:
parent
4d9fb6825c
commit
d757f44557
@ -27,22 +27,21 @@ pub enum ParseError {
|
||||
|
||||
impl fmt::Display for ParseError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
f.write_str(self.description())
|
||||
let display = match self {
|
||||
ParseError::Invalid => "Invalid header value".to_string(),
|
||||
ParseError::MissingScheme => {
|
||||
"Missing authorization scheme".to_string()
|
||||
}
|
||||
ParseError::MissingField(_) => "Missing header field".to_string(),
|
||||
ParseError::ToStrError(e) => e.to_string(),
|
||||
ParseError::Base64DecodeError(e) => e.to_string(),
|
||||
ParseError::Utf8Error(e) => e.to_string(),
|
||||
};
|
||||
f.write_str(&display)
|
||||
}
|
||||
}
|
||||
|
||||
impl Error for ParseError {
|
||||
fn description(&self) -> &str {
|
||||
match self {
|
||||
ParseError::Invalid => "Invalid header value",
|
||||
ParseError::MissingScheme => "Missing authorization scheme",
|
||||
ParseError::MissingField(_) => "Missing header field",
|
||||
ParseError::ToStrError(e) => e.description(),
|
||||
ParseError::Base64DecodeError(e) => e.description(),
|
||||
ParseError::Utf8Error(e) => e.description(),
|
||||
}
|
||||
}
|
||||
|
||||
fn source(&self) -> Option<&(dyn Error + 'static)> {
|
||||
match self {
|
||||
ParseError::Invalid => None,
|
||||
|
Loading…
x
Reference in New Issue
Block a user