about summary refs log tree commit diff
path: root/tvix/eval/src/value/attrs.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-08-19T15·17+0200
committerflokli <flokli@flokli.de>2023-08-20T21·51+0000
commit690884426bc1809683b2f57c6c18b88163c87363 (patch)
tree8d9724d29985010f46e151ed8bace9fe5f38891e /tvix/eval/src/value/attrs.rs
parent3ffbcc6c8a9bca119248d4ffe00c24a903979e1a (diff)
refactor(tvix/eval): derive default for value::AttrsRep enum r/6501
Change-Id: Iaeb9ed7024c2ce85373f8aec0d223f52e1a3a539
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9097
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/value/attrs.rs')
-rw-r--r--tvix/eval/src/value/attrs.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/tvix/eval/src/value/attrs.rs b/tvix/eval/src/value/attrs.rs
index bacfd22217bd..5ec5b8ccc77c 100644
--- a/tvix/eval/src/value/attrs.rs
+++ b/tvix/eval/src/value/attrs.rs
@@ -30,8 +30,9 @@ lazy_static! {
 #[cfg(test)]
 mod tests;
 
-#[derive(Clone, Debug, Deserialize)]
+#[derive(Clone, Debug, Deserialize, Default)]
 pub(super) enum AttrsRep {
+    #[default]
     Empty,
 
     Im(OrdMap<NixString, Value>),
@@ -45,12 +46,6 @@ pub(super) enum AttrsRep {
     },
 }
 
-impl Default for AttrsRep {
-    fn default() -> Self {
-        AttrsRep::Empty
-    }
-}
-
 impl AttrsRep {
     /// Retrieve reference to a mutable map inside of an attrs,
     /// optionally changing the representation if required.