From f32abc57cf32fa2400f94a087462abe55e6c790a Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Sun, 27 Nov 2022 23:56:19 -0800 Subject: feat(tvix/eval): impl Default for AttrsRep Change-Id: I3a55413e5004777b90c06cd8655f26abb2faf39b Reviewed-on: https://cl.tvl.fyi/c/depot/+/7448 Autosubmit: Adam Joseph Reviewed-by: tazjin Tested-by: BuildkiteCI --- tvix/eval/src/value/attrs.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tvix') diff --git a/tvix/eval/src/value/attrs.rs b/tvix/eval/src/value/attrs.rs index 1593ab19d3aa..fced32a865a6 100644 --- a/tvix/eval/src/value/attrs.rs +++ b/tvix/eval/src/value/attrs.rs @@ -33,6 +33,12 @@ 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. @@ -79,7 +85,7 @@ impl AttrsRep { } #[repr(transparent)] -#[derive(Clone, Debug)] +#[derive(Clone, Debug, Default)] pub struct NixAttrs(AttrsRep); impl TotalDisplay for NixAttrs { -- cgit 1.4.1