aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Huss <eric@huss.org>2019-12-22 09:46:36 -0800
committerGitHub <noreply@github.com>2019-12-22 09:46:36 -0800
commit1b8e0d78bd208fc566fc5d627b3c3147e64113b1 (patch)
treed56c955470b9376fcbf4dcb254e3a1148a2ccdfe
parent60b874308e6792a73cc00517a60bbef60a12e3cc (diff)
parentb9507d859d27d68b954a76202e60c5cf50c5604d (diff)
downloadmilf-rs-1b8e0d78bd208fc566fc5d627b3c3147e64113b1.tar.gz
milf-rs-1b8e0d78bd208fc566fc5d627b3c3147e64113b1.zip
Merge pull request #365 from AnderEnder/remove-deprecated-error-description
Remove deprecated Error::description
-rw-r--r--src/datetime.rs6
-rw-r--r--src/de.rs30
-rw-r--r--src/ser.rs17
3 files changed, 3 insertions, 50 deletions
diff --git a/src/datetime.rs b/src/datetime.rs
index 683bbda..bbaa30c 100644
--- a/src/datetime.rs
+++ b/src/datetime.rs
@@ -422,8 +422,4 @@ impl fmt::Display for DatetimeParseError {
}
}
-impl error::Error for DatetimeParseError {
- fn description(&self) -> &str {
- "failed to parse datetime"
- }
-}
+impl error::Error for DatetimeParseError {}
diff --git a/src/de.rs b/src/de.rs
index 5a0d0c7..98b3a60 100644
--- a/src/de.rs
+++ b/src/de.rs
@@ -2153,35 +2153,7 @@ impl fmt::Display for Error {
}
}
-impl error::Error for Error {
- fn description(&self) -> &str {
- match self.inner.kind {
- ErrorKind::UnexpectedEof => "unexpected eof encountered",
- ErrorKind::InvalidCharInString(_) => "invalid char in string",
- ErrorKind::InvalidEscape(_) => "invalid escape in string",
- ErrorKind::InvalidHexEscape(_) => "invalid hex escape in string",
- ErrorKind::InvalidEscapeValue(_) => "invalid escape value in string",
- ErrorKind::NewlineInString => "newline in string found",
- ErrorKind::Unexpected(_) => "unexpected or invalid character",
- ErrorKind::UnterminatedString => "unterminated string",
- ErrorKind::NewlineInTableKey => "found newline in table key",
- ErrorKind::Wanted { .. } => "expected a token but found another",
- ErrorKind::NumberInvalid => "invalid number",
- ErrorKind::DateInvalid => "invalid date",
- ErrorKind::DuplicateTable(_) => "duplicate table",
- ErrorKind::RedefineAsArray => "table redefined as array",
- ErrorKind::EmptyTableKey => "empty table key found",
- ErrorKind::MultilineStringKey => "invalid multiline string for key",
- ErrorKind::Custom => "a custom error",
- ErrorKind::ExpectedTuple(_) => "expected table length",
- ErrorKind::ExpectedTupleIndex { .. } => "expected table key",
- ErrorKind::ExpectedEmptyTable => "expected empty table",
- ErrorKind::DottedKeyInvalidType => "dotted key invalid type",
- ErrorKind::UnexpectedKeys { .. } => "unexpected keys in table",
- ErrorKind::__Nonexhaustive => panic!(),
- }
- }
-}
+impl error::Error for Error {}
impl de::Error for Error {
fn custom<T: fmt::Display>(msg: T) -> Error {
diff --git a/src/ser.rs b/src/ser.rs
index d81f75e..fd72930 100644
--- a/src/ser.rs
+++ b/src/ser.rs
@@ -1542,22 +1542,7 @@ impl fmt::Display for Error {
}
}
-impl error::Error for Error {
- fn description(&self) -> &str {
- match *self {
- Error::UnsupportedType => "unsupported Rust type",
- Error::KeyNotString => "map key was not a string",
- Error::ValueAfterTable => "values must be emitted before tables",
- Error::DateInvalid => "a serialized date was invalid",
- Error::NumberInvalid => "a serialized number was invalid",
- Error::UnsupportedNone => "unsupported None value",
- Error::Custom(_) => "custom error",
- Error::KeyNewline => unreachable!(),
- Error::ArrayMixedType => unreachable!(),
- Error::__Nonexhaustive => panic!(),
- }
- }
-}
+impl error::Error for Error {}
impl ser::Error for Error {
fn custom<T: fmt::Display>(msg: T) -> Error {