Refine code.
This commit is contained in:
parent
96dbbc76e4
commit
b961a10d27
@ -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::<Dynamic>::into).collect()
|
||||
}
|
||||
#[rhai_fn(pure)]
|
||||
pub fn values(map: &mut Map) -> Array {
|
||||
map.iter().map(|(_, v)| v.clone()).collect()
|
||||
map.values().cloned().collect()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user