diff options
Diffstat (limited to 'dhall/src/semantics/nze/lazy.rs')
-rw-r--r-- | dhall/src/semantics/nze/lazy.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/dhall/src/semantics/nze/lazy.rs b/dhall/src/semantics/nze/lazy.rs index 550f69a..d3b5c8d 100644 --- a/dhall/src/semantics/nze/lazy.rs +++ b/dhall/src/semantics/nze/lazy.rs @@ -63,6 +63,17 @@ where } } +/// This implementation evaluates before cloning, because we can't clone the contents of a `Cell`. +impl<Src, Tgt> Clone for Lazy<Src, Tgt> +where + Src: Eval<Tgt>, + Tgt: Clone, +{ + fn clone(&self) -> Self { + Self::new_completed(self.force().clone()) + } +} + impl<Src, Tgt> Debug for Lazy<Src, Tgt> where Tgt: Debug, |