fix: default clippy lints

This commit is contained in:
Mathieu Lala
2022-12-30 18:07:39 +01:00
parent 4c2630b71f
commit 9af5b1c78e
42 changed files with 191 additions and 190 deletions

View File

@@ -245,16 +245,16 @@ impl Engine {
g.source = orig_source;
});
self.eval_global_statements(global, caches, scope, ast.statements())
.and_then(|r| {
#[cfg(feature = "debugging")]
if self.is_debugger_registered() {
global.debugger_mut().status = crate::eval::DebuggerStatus::Terminate;
let node = &crate::ast::Stmt::Noop(Position::NONE);
self.run_debugger(global, caches, scope, None, node)?;
}
Ok(r)
})
let r = self.eval_global_statements(global, caches, scope, ast.statements())?;
#[cfg(feature = "debugging")]
if self.is_debugger_registered() {
global.debugger_mut().status = crate::eval::DebuggerStatus::Terminate;
let node = &crate::ast::Stmt::Noop(Position::NONE);
self.run_debugger(global, caches, scope, None, node)?;
}
Ok(r)
}
}

View File

@@ -97,7 +97,7 @@ impl Engine {
///
/// // Compile a script to an AST and store it for later evaluation.
/// // Notice that a PathBuf is required which can easily be constructed from a string.
/// let ast = engine.compile_file_with_scope(&mut scope, "script.rhai".into())?;
/// let ast = engine.compile_file_with_scope(&scope, "script.rhai".into())?;
///
/// let result = engine.eval_ast::<i64>(&ast)?;
/// # }

View File

@@ -126,16 +126,16 @@ impl Engine {
global.embedded_module_resolver = ast.resolver().cloned();
}
self.eval_global_statements(global, caches, scope, ast.statements())
.and_then(|_| {
#[cfg(feature = "debugging")]
if self.is_debugger_registered() {
global.debugger_mut().status = crate::eval::DebuggerStatus::Terminate;
let node = &crate::ast::Stmt::Noop(crate::Position::NONE);
self.run_debugger(global, caches, scope, None, node)?;
}
Ok(())
})
let _ = self.eval_global_statements(global, caches, scope, ast.statements())?;
#[cfg(feature = "debugging")]
if self.is_debugger_registered() {
global.debugger_mut().status = crate::eval::DebuggerStatus::Terminate;
let node = &crate::ast::Stmt::Noop(crate::Position::NONE);
self.run_debugger(global, caches, scope, None, node)?;
}
Ok(())
}
}