Happy clippy is happy (and Clippy)

This commit is contained in:
Emmanuel BENOîT 2023-01-07 11:59:32 +01:00
parent 8741692fad
commit 6252bed605
2 changed files with 3 additions and 4 deletions

View file

@ -33,7 +33,7 @@ impl<'a> InterpreterState<'a> {
Self {
environment: env.clone(),
globals: env,
locals: &locals,
locals,
}
}

View file

@ -76,11 +76,10 @@ impl<'a> ResolverState<'a> {
self.scopes[self.scopes.len() - 1]
.values()
.filter(|v| v.state != SymState::Used)
.filter(|v| !v.decl.lexeme.starts_with("_"))
.nth(0)
.find(|v| !v.decl.lexeme.starts_with('_'))
.map_or(Ok(()), |v| {
self.error(
&v.decl,
v.decl,
"unused symbol; prefix its name with '_' to avoid this error",
)
})