mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 03:25:10 +02:00
Match cleanup (#2248)
This commit is contained in:
@ -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
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user