Deref before matching
rust-guidelines encourages this
This commit is contained in:
parent
424dbb29ed
commit
accf2f3cc3
1 changed files with 3 additions and 3 deletions
|
|
@ -84,9 +84,9 @@ pub enum CreationError {
|
||||||
|
|
||||||
impl CreationError {
|
impl CreationError {
|
||||||
fn to_string(&self) -> &str {
|
fn to_string(&self) -> &str {
|
||||||
match self {
|
match *self {
|
||||||
&CreationError::OsError(ref text) => text.as_slice(),
|
CreationError::OsError(ref text) => text.as_slice(),
|
||||||
&CreationError::NotSupported => "Some of the requested attributes are not supported",
|
CreationError::NotSupported => "Some of the requested attributes are not supported",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue