From 598eef2595dfea7f488149a354f9dd7832d053f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9F=B3=E5=8D=9A=E6=96=87?= Date: Tue, 12 Nov 2024 23:06:22 +0800 Subject: [PATCH] chore: Reduce string copy --- lib/src/ast/variable.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/ast/variable.rs b/lib/src/ast/variable.rs index 19803d8..9cd9de8 100644 --- a/lib/src/ast/variable.rs +++ b/lib/src/ast/variable.rs @@ -44,8 +44,8 @@ impl Variable { ty: Type, ) -> SmallVec8> { names - .iter() - .map(|x| Arc::new(Self::with_type(x.clone(), ty.clone()))) + .into_iter() + .map(|x| Arc::new(Self::with_type(x, ty.clone()))) .collect() }