Code cleanup

This commit is contained in:
Stephen Chung
2020-11-25 09:36:06 +08:00
parent 05d51ef510
commit a0979d0c35
19 changed files with 187 additions and 160 deletions

View File

@@ -5,7 +5,7 @@ use crate::{calc_script_fn_hash, def_package, FnPtr, ImmutableString, NativeCall
#[cfg(not(feature = "no_function"))]
#[cfg(not(feature = "no_index"))]
#[cfg(not(feature = "no_object"))]
use crate::{module::SharedScriptFnDef, stdlib::collections::HashMap, Array, Map};
use crate::{ast::ScriptFnDef, stdlib::collections::HashMap, Array, Map};
def_package!(crate:BasicFnPackage:"Basic Fn functions.", lib, {
combine_with_exported_module!(lib, "FnPtr", fn_ptr_functions);
@@ -54,7 +54,7 @@ fn collect_fn_metadata(ctx: NativeCallContext) -> Array {
fn make_metadata(
dict: &HashMap<&str, ImmutableString>,
namespace: Option<ImmutableString>,
f: SharedScriptFnDef,
f: &ScriptFnDef,
) -> Map {
let mut map = Map::with_capacity(6);

View File

@@ -26,7 +26,7 @@ where
fn next(&mut self) -> Option<T> {
if self.0 < self.1 {
let v = self.0.clone();
self.0 = &v + &self.2;
self.0 = self.0.add(&self.2);
Some(v)
} else {
None