summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorBryant Mairs <bryantmairs@google.com>2017-12-16 09:22:53 -0800
committerBryant Mairs <bryantmairs@google.com>2017-12-20 07:05:04 -0800
commitf91586f4519a2ec1af9fddc7e667ba0b9a22d579 (patch)
treebbac0fc19e6eb859d6d9bbce797726cde013e20e /src/lib.rs
parent0691ed1383ad50b9cf0d95561b908b7fadf2295e (diff)
downloadnix-f91586f4519a2ec1af9fddc7e667ba0b9a22d579.zip
Dereference in match head instead
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 8ddfad9b..8a63c072 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -128,22 +128,22 @@ impl From<std::string::FromUtf8Error> for Error {
impl error::Error for Error {
fn description(&self) -> &str {
- match self {
- &Error::InvalidPath => "Invalid path",
- &Error::InvalidUtf8 => "Invalid UTF-8 string",
- &Error::UnsupportedOperation => "Unsupported Operation",
- &Error::Sys(ref errno) => errno.desc(),
+ match *self {
+ Error::InvalidPath => "Invalid path",
+ Error::InvalidUtf8 => "Invalid UTF-8 string",
+ Error::UnsupportedOperation => "Unsupported Operation",
+ Error::Sys(ref errno) => errno.desc(),
}
}
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- match self {
- &Error::InvalidPath => write!(f, "Invalid path"),
- &Error::InvalidUtf8 => write!(f, "Invalid UTF-8 string"),
- &Error::UnsupportedOperation => write!(f, "Unsupported Operation"),
- &Error::Sys(errno) => write!(f, "{:?}: {}", errno, errno.desc()),
+ match *self {
+ Error::InvalidPath => write!(f, "Invalid path"),
+ Error::InvalidUtf8 => write!(f, "Invalid UTF-8 string"),
+ Error::UnsupportedOperation => write!(f, "Unsupported Operation"),
+ Error::Sys(errno) => write!(f, "{:?}: {}", errno, errno.desc()),
}
}
}