Forbid shadowing of state variable.
This commit is contained in:
@@ -56,7 +56,11 @@ pub fn main() {
|
||||
};
|
||||
|
||||
// Create Engine
|
||||
let engine = Engine::new();
|
||||
let mut engine = Engine::new();
|
||||
|
||||
// Prevent shadowing of `state`
|
||||
#[allow(deprecated)]
|
||||
engine.on_def_var(|_, info, _| Ok(info.name != "state"));
|
||||
|
||||
// Create a custom 'Scope' to hold state
|
||||
let mut scope = Scope::new();
|
||||
|
Reference in New Issue
Block a user