code cleanup.
This commit is contained in:
@@ -6,7 +6,7 @@ use crate::{Dynamic, Engine, Scope};
|
||||
use std::prelude::v1::*;
|
||||
|
||||
/// Context of a script evaluation process.
|
||||
#[derive(Debug)]
|
||||
#[allow(dead_code)]
|
||||
pub struct EvalContext<'a, 's, 'ps, 'g, 'c, 't> {
|
||||
/// The current [`Engine`].
|
||||
engine: &'a Engine,
|
||||
|
@@ -3,7 +3,7 @@
|
||||
use super::{Caches, EvalContext, GlobalRuntimeState, Target};
|
||||
use crate::api::events::VarDefInfo;
|
||||
use crate::ast::{
|
||||
ASTFlags, BinaryExpr, Expr, Ident, OpAssignment, Stmt, SwitchCasesCollection, TryCatchBlock,
|
||||
ASTFlags, BinaryExpr, Expr, OpAssignment, Stmt, SwitchCasesCollection, TryCatchBlock,
|
||||
};
|
||||
use crate::func::{get_builtin_op_assignment_fn, get_hasher};
|
||||
use crate::types::dynamic::{AccessMode, Union};
|
||||
@@ -834,6 +834,7 @@ impl Engine {
|
||||
// Export statement
|
||||
#[cfg(not(feature = "no_module"))]
|
||||
Stmt::Export(x, ..) => {
|
||||
use crate::ast::Ident;
|
||||
let (Ident { name, pos, .. }, Ident { name: alias, .. }) = &**x;
|
||||
// Mark scope variables as public
|
||||
scope.search(name).map_or_else(
|
||||
|
@@ -665,6 +665,7 @@ mod range_functions {
|
||||
}
|
||||
/// Return true if the range contains no items.
|
||||
#[rhai_fn(get = "is_empty", name = "is_empty", pure)]
|
||||
#[allow(unstable_name_collisions)]
|
||||
pub fn is_empty_exclusive(range: &mut ExclusiveRange) -> bool {
|
||||
range.is_empty()
|
||||
}
|
||||
|
@@ -1175,6 +1175,7 @@ impl Dynamic {
|
||||
/// ```
|
||||
#[inline]
|
||||
#[must_use]
|
||||
#[allow(unused_mut)]
|
||||
pub fn try_cast<T: Any>(mut self) -> Option<T> {
|
||||
// Coded this way in order to maximally leverage potentials for dead-code removal.
|
||||
|
||||
|
Reference in New Issue
Block a user