Shut up clippy.

This commit is contained in:
Stephen Chung
2022-08-29 14:27:05 +08:00
parent 1389541e7d
commit 80772df4f4
20 changed files with 100 additions and 121 deletions

View File

@@ -144,11 +144,10 @@ impl Engine {
let (index, var_pos) = match expr {
// Check if the variable is `this`
Expr::Variable(v, None, pos) if v.0.is_none() && v.3 == KEYWORD_THIS => {
return if let Some(val) = this_ptr {
Ok(((*val).into(), *pos))
} else {
Err(ERR::ErrorUnboundThis(*pos).into())
}
return this_ptr.as_mut().map_or_else(
|| Err(ERR::ErrorUnboundThis(*pos).into()),
|val| Ok(((*val).into(), *pos)),
)
}
_ if global.always_search_scope => (0, expr.start_position()),
Expr::Variable(.., Some(i), pos) => (i.get() as usize, *pos),