Match cleanup (#2248)

This commit is contained in:
Joseph T. Lyons
2020-07-25 08:40:35 -04:00
committed by GitHub
parent a77f0f7b41
commit de18b9ca2c
12 changed files with 40 additions and 123 deletions

View File

@ -69,10 +69,7 @@ impl EvaluatedArgs {
/// Return true if the set of named arguments contains the name provided
pub fn has(&self, name: &str) -> bool {
match &self.named {
None => false,
Some(named) => named.contains_key(name),
}
matches!(&self.named, Some(named) if named.contains_key(name))
}
/// Gets the corresponding Value for the named argument given, if possible

View File

@ -64,10 +64,7 @@ impl Ord for Dictionary {
impl PartialEq<Value> for Dictionary {
/// Test a dictionary against a Value for equality
fn eq(&self, other: &Value) -> bool {
match &other.value {
UntaggedValue::Row(d) => self == d,
_ => false,
}
matches!(&other.value, UntaggedValue::Row(d) if self == d)
}
}