From a8970a4c99e4a72f9c614be935c35ec20072e759 Mon Sep 17 00:00:00 2001 From: Yago Iglesias Date: Mon, 6 May 2024 16:47:25 +0200 Subject: [PATCH] refactor: use clone_from instead of clone --- src/compiler/mod.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/compiler/mod.rs b/src/compiler/mod.rs index 4e03008..e11dda9 100644 --- a/src/compiler/mod.rs +++ b/src/compiler/mod.rs @@ -62,14 +62,8 @@ impl CompilerScope { fn leave_loop_scope(&mut self) -> Option>> { let outer = self.loop_scope.clone(); - self.loop_scope = self - .loop_scope - .clone() - .unwrap() - .as_ref() - .borrow() - .outer - .clone(); + self.loop_scope + .clone_from(&self.loop_scope.clone().unwrap().as_ref().borrow().outer); outer } }