Avoid warnings.

This commit is contained in:
Stephen Chung
2020-07-26 15:53:22 +08:00
parent 5e48478496
commit 6b600704a3
27 changed files with 624 additions and 321 deletions

View File

@@ -1,30 +1,33 @@
//! Module that defines the extern API of `Engine`.
use crate::any::{Dynamic, Variant};
use crate::engine::{make_getter, make_setter, Engine, Imports, State, FN_IDX_GET, FN_IDX_SET};
use crate::engine::{Engine, Imports, State};
use crate::error::ParseError;
use crate::fn_args::FuncArgs;
use crate::fn_native::{IteratorFn, SendSync};
use crate::fn_register::RegisterFn;
use crate::module::{FuncReturn, Module};
use crate::optimize::{optimize_into_ast, OptimizationLevel};
use crate::parser::AST;
use crate::result::EvalAltResult;
use crate::scope::Scope;
use crate::token::{lex, Position};
use crate::utils::StaticVec;
#[cfg(not(feature = "no_index"))]
#[cfg(not(feature = "no_object"))]
use crate::engine::{FN_IDX_GET, FN_IDX_SET};
#[cfg(not(feature = "no_object"))]
use crate::engine::Map;
use crate::{
engine::{make_getter, make_setter, Map},
fn_register::RegisterFn,
};
#[cfg(not(feature = "no_function"))]
use crate::engine::get_script_function_by_signature;
use crate::{engine::get_script_function_by_signature, fn_args::FuncArgs, utils::StaticVec};
use crate::stdlib::{
any::{type_name, TypeId},
boxed::Box,
mem,
string::{String, ToString},
};
#[cfg(not(feature = "no_std"))]
@@ -293,7 +296,7 @@ impl Engine {
self.type_names
.as_mut()
.unwrap()
.insert(type_name::<T>().to_string(), name.to_string());
.insert(type_name::<T>().into(), name.into());
self
}