Deref before matching

rust-guidelines encourages this
This commit is contained in:
Corey Farwell 2015-02-21 18:07:35 -05:00
parent 424dbb29ed
commit accf2f3cc3

View file

@ -84,9 +84,9 @@ pub enum CreationError {
impl CreationError {
fn to_string(&self) -> &str {
match self {
&CreationError::OsError(ref text) => text.as_slice(),
&CreationError::NotSupported => "Some of the requested attributes are not supported",
match *self {
CreationError::OsError(ref text) => text.as_slice(),
CreationError::NotSupported => "Some of the requested attributes are not supported",
}
}
}