aboutsummaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/error.rs b/src/error.rs
index 6390c43..1875ef0 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -284,9 +284,9 @@ impl Error {
impl Display for ErrorCode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- match *self {
- ErrorCode::Message(ref msg) => f.write_str(msg),
- ErrorCode::Io(ref err) => Display::fmt(err, f),
+ match self {
+ ErrorCode::Message(msg) => f.write_str(msg),
+ ErrorCode::Io(err) => Display::fmt(err, f),
ErrorCode::EofWhileParsingList => f.write_str("EOF while parsing a list"),
ErrorCode::EofWhileParsingObject => f.write_str("EOF while parsing an object"),
ErrorCode::EofWhileParsingString => f.write_str("EOF while parsing a string"),
@@ -318,8 +318,8 @@ impl Display for ErrorCode {
impl serde::de::StdError for Error {
#[cfg(feature = "std")]
fn source(&self) -> Option<&(dyn error::Error + 'static)> {
- match self.err.code {
- ErrorCode::Io(ref err) => Some(err),
+ match &self.err.code {
+ ErrorCode::Io(err) => Some(err),
_ => None,
}
}
@@ -438,7 +438,7 @@ fn parse_line_col(msg: &mut String) -> Option<(usize, usize)> {
}
fn starts_with_digit(slice: &str) -> bool {
- match slice.as_bytes().get(0) {
+ match slice.as_bytes().first() {
None => false,
Some(&byte) => byte >= b'0' && byte <= b'9',
}