diff options
Diffstat (limited to 'tvix/eval/src/value')
-rw-r--r-- | tvix/eval/src/value/attrs.rs | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/tvix/eval/src/value/attrs.rs b/tvix/eval/src/value/attrs.rs index 74f1bd4481b2..922aa0c0d37a 100644 --- a/tvix/eval/src/value/attrs.rs +++ b/tvix/eval/src/value/attrs.rs @@ -51,17 +51,11 @@ impl AttrsRep { match self { AttrsRep::Empty => None, - AttrsRep::KV { name, value } => { - if key == "name" { - return Some(name); - } - - if key == "value" { - return Some(value); - } - - None - } + AttrsRep::KV { name, value } => match key { + "name" => Some(name), + "value" => Some(value), + _ => None, + }, AttrsRep::Map(map) => map.get(&key.into()), } |