Code style and docs.

This commit is contained in:
Stephen Chung
2021-03-17 13:30:47 +08:00
parent 699131be58
commit 6667a22c0c
12 changed files with 172 additions and 103 deletions

View File

@@ -108,8 +108,8 @@ fn collect_fn_metadata(ctx: NativeCallContext) -> crate::Array {
list.push(make_metadata(dict, Some(namespace.clone()), f).into())
});
module.iter_sub_modules().for_each(|(ns, m)| {
let ns: ImmutableString = format!("{}::{}", namespace, ns).into();
scan_module(list, dict, ns, m.as_ref())
let ns = format!("{}::{}", namespace, ns);
scan_module(list, dict, ns.into(), m.as_ref())
});
}

View File

@@ -29,15 +29,11 @@ mod map_functions {
}
#[rhai_fn(name = "mixin", name = "+=")]
pub fn mixin(map: &mut Map, map2: Map) {
map2.into_iter().for_each(|(key, value)| {
map.insert(key, value);
});
map.extend(map2.into_iter());
}
#[rhai_fn(name = "+")]
pub fn merge(mut map: Map, map2: Map) -> Map {
map2.into_iter().for_each(|(key, value)| {
map.insert(key, value);
});
map.extend(map2.into_iter());
map
}
pub fn fill_with(map: &mut Map, map2: Map) {