about summary refs log tree commit diff
path: root/tvix/eval/src/compiler/scope.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval/src/compiler/scope.rs')
-rw-r--r--tvix/eval/src/compiler/scope.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/tvix/eval/src/compiler/scope.rs b/tvix/eval/src/compiler/scope.rs
index eb722a2c69..874c6168c1 100644
--- a/tvix/eval/src/compiler/scope.rs
+++ b/tvix/eval/src/compiler/scope.rs
@@ -180,10 +180,11 @@ impl Scope {
     /// correctly nesting scopes in lambdas and thunks when special
     /// scope features like poisoning are present).
     pub fn inherit(&self) -> Self {
-        let mut scope = Self::default();
-        scope.poisoned_tokens = self.poisoned_tokens.clone();
-        scope.scope_depth = self.scope_depth;
-        scope
+        Self {
+            poisoned_tokens: self.poisoned_tokens.clone(),
+            scope_depth: self.scope_depth,
+            ..Default::default()
+        }
     }
 
     /// Check whether a given token is poisoned.