diff --git a/src/api/register.rs b/src/api/register.rs index be335d2af..998aad2e2 100644 --- a/src/api/register.rs +++ b/src/api/register.rs @@ -75,10 +75,10 @@ impl Engine { name: impl AsRef + Into, func: FUNC, ) -> &mut Self { - let mut reg = FuncRegistration::new(name.into()).with_namespace(FnNamespace::Global); + let reg = FuncRegistration::new(name.into()).with_namespace(FnNamespace::Global); #[cfg(feature = "metadata")] - { + let reg = { let mut param_type_names = FUNC::param_names() .iter() .map(|ty| format!("_: {}", self.format_param_type(ty))) @@ -93,8 +93,8 @@ impl Engine { .map(String::as_str) .collect::>(); - reg = reg.with_params_info(param_type_names); - } + reg.with_params_info(param_type_names) + }; reg.set_into_module(self.global_namespace_mut(), func); diff --git a/src/module/mod.rs b/src/module/mod.rs index 918b9bfc9..6d9d31a3d 100644 --- a/src/module/mod.rs +++ b/src/module/mod.rs @@ -445,6 +445,7 @@ impl FuncRegistration { f.num_params = arg_types.as_ref().len(); f.param_types.extend(arg_types.as_ref().iter().copied()); + #[cfg(any(not(feature = "no_index"), not(feature = "no_object")))] if (f.name == crate::engine::FN_IDX_GET && f.num_params == 2) || (f.name == crate::engine::FN_IDX_SET && f.num_params == 3) { diff --git a/src/tokenizer.rs b/src/tokenizer.rs index 191fb6d12..b6ef01e8a 100644 --- a/src/tokenizer.rs +++ b/src/tokenizer.rs @@ -1591,8 +1591,8 @@ fn get_next_token_inner( let mut result = SmartString::new_const(); let mut radix_base: Option = None; let mut valid: fn(char) -> bool = is_numeric_digit; - let mut has_period = false; - let mut has_e = false; + let mut _has_period = false; + let mut _has_e = false; result.push(c); @@ -1606,7 +1606,7 @@ fn get_next_token_inner( stream.eat_next_and_advance(pos); } #[cfg(any(not(feature = "no_float"), feature = "decimal"))] - '.' if !has_period && radix_base.is_none() => { + '.' if !_has_period && radix_base.is_none() => { stream.get_next().unwrap(); // Check if followed by digits or something that cannot start a property name @@ -1615,7 +1615,7 @@ fn get_next_token_inner( Some('0'..='9') => { result.push('.'); pos.advance(); - has_period = true; + _has_period = true; } // _ - cannot follow a decimal point Some(NUMBER_SEPARATOR) => { @@ -1632,7 +1632,7 @@ fn get_next_token_inner( result.push('.'); pos.advance(); result.push('0'); - has_period = true; + _has_period = true; } // Not a floating-point number _ => { @@ -1642,7 +1642,7 @@ fn get_next_token_inner( } } #[cfg(not(feature = "no_float"))] - 'e' if !has_e && radix_base.is_none() => { + 'e' if !_has_e && radix_base.is_none() => { stream.get_next().unwrap(); // Check if followed by digits or +/- @@ -1651,8 +1651,8 @@ fn get_next_token_inner( Some('0'..='9') => { result.push('e'); pos.advance(); - has_e = true; - has_period = true; + _has_e = true; + _has_period = true; } // +/- after e - accept the e and the sign (no decimal points allowed) Some('+' | '-') => { @@ -1660,8 +1660,8 @@ fn get_next_token_inner( pos.advance(); result.push(stream.get_next().unwrap()); pos.advance(); - has_e = true; - has_period = true; + _has_e = true; + _has_period = true; } // Not a floating-point number _ => {