Satisfy more clippy.

This commit is contained in:
Stephen Chung
2022-11-23 16:14:11 +08:00
parent 9f5b68549a
commit 3e7408511e
20 changed files with 150 additions and 146 deletions

View File

@@ -259,7 +259,7 @@ impl Engine {
);
}
#[allow(clippy::cast_sign_loss)]
#[allow(clippy::cast_sign_loss, clippy::cast_possible_truncation)]
let offset = index as usize;
(
s.chars().nth(offset).ok_or_else(|| {

View File

@@ -471,14 +471,11 @@ impl Engine {
let event = match global.debugger.status {
DebuggerStatus::Init => Some(DebuggerEvent::Start),
DebuggerStatus::CONTINUE => None,
DebuggerStatus::NEXT if matches!(node, ASTNode::Stmt(..)) => Some(DebuggerEvent::Step),
DebuggerStatus::NEXT => None,
DebuggerStatus::INTO if matches!(node, ASTNode::Expr(..)) => Some(DebuggerEvent::Step),
DebuggerStatus::INTO => None,
DebuggerStatus::NEXT if node.is_stmt() => Some(DebuggerEvent::Step),
DebuggerStatus::INTO if node.is_expr() => Some(DebuggerEvent::Step),
DebuggerStatus::STEP => Some(DebuggerEvent::Step),
DebuggerStatus::FunctionExit(..) => None,
DebuggerStatus::Terminate => Some(DebuggerEvent::End),
_ => None,
};
let event = match event {