Combine redundant match arm bodies.
This commit is contained in:
@@ -39,9 +39,9 @@ impl StdError for Error {
|
||||
fn description(&self) -> &str {
|
||||
use Error::*;
|
||||
match *self {
|
||||
Syntax(ref s) => s,
|
||||
UndefVariable(ref s) => s,
|
||||
Backref(ref s) => s,
|
||||
Syntax(ref s) |
|
||||
UndefVariable(ref s) |
|
||||
Backref(ref s) |
|
||||
DuplicateDef(ref s) => s,
|
||||
Regex(ref err) => err.description(),
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ impl Part {
|
||||
/// Get the variabled referenced by this part, if any.
|
||||
pub fn ref_var(&self) -> Option<&str> {
|
||||
match *self {
|
||||
Part::Var(ref var) => Some(var),
|
||||
Part::Var(ref var) |
|
||||
Part::DefVar { ref var, .. } => Some(var),
|
||||
_ => None,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user