From b961a10d279c94b24d0e974ceb46286be568cc1f Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Sun, 12 Sep 2021 14:33:48 +0800 Subject: [PATCH] Refine code. --- src/packages/map_basic.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/packages/map_basic.rs b/src/packages/map_basic.rs index b7e52bc3..213500a5 100644 --- a/src/packages/map_basic.rs +++ b/src/packages/map_basic.rs @@ -88,11 +88,11 @@ mod map_functions { pub mod indexing { #[rhai_fn(pure)] pub fn keys(map: &mut Map) -> Array { - map.iter().map(|(k, _)| k.clone().into()).collect() + map.keys().cloned().map(Into::::into).collect() } #[rhai_fn(pure)] pub fn values(map: &mut Map) -> Array { - map.iter().map(|(_, v)| v.clone()).collect() + map.values().cloned().collect() } } }