Merge branch 'main' of https://github.com/rhaiscript/rhai
This commit is contained in:
@@ -268,7 +268,7 @@ impl Engine {
|
||||
|
||||
// Check for data race.
|
||||
#[cfg(not(feature = "no_closure"))]
|
||||
crate::func::call::ensure_no_data_race(name, &mut args, false)?;
|
||||
crate::func::call::ensure_no_data_race(name, &args, false)?;
|
||||
|
||||
let lib = &[ast.as_ref()];
|
||||
let fn_def = ast
|
||||
|
@@ -149,7 +149,7 @@ impl Expression<'_> {
|
||||
impl AsRef<Expr> for Expression<'_> {
|
||||
#[inline(always)]
|
||||
fn as_ref(&self) -> &Expr {
|
||||
&self.0
|
||||
self.0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ impl Deref for Expression<'_> {
|
||||
|
||||
#[inline(always)]
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.0
|
||||
self.0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ impl Engine {
|
||||
///
|
||||
/// Not available under `no_custom_syntax`.
|
||||
///
|
||||
/// * `symbols` holds a slice of strings that define the custom syntax.
|
||||
/// * `symbols` holds a slice of strings that define the custom syntax.
|
||||
/// * `scope_may_be_changed` specifies variables _may_ be added/removed by this custom syntax.
|
||||
/// * `func` is the implementation function.
|
||||
///
|
||||
@@ -365,8 +365,7 @@ impl Engine {
|
||||
parse: Box::new(parse),
|
||||
func: Box::new(func),
|
||||
scope_may_be_changed,
|
||||
}
|
||||
.into(),
|
||||
},
|
||||
);
|
||||
self
|
||||
}
|
||||
|
@@ -102,8 +102,8 @@ fn map_std_type_name(name: &str, shorthands: bool) -> &str {
|
||||
};
|
||||
}
|
||||
|
||||
if name.starts_with("rhai::") {
|
||||
map_std_type_name(&name[6..], shorthands)
|
||||
if let Some(stripped) = name.strip_prefix("rhai::") {
|
||||
map_std_type_name(stripped, shorthands)
|
||||
} else {
|
||||
name
|
||||
}
|
||||
|
Reference in New Issue
Block a user