dead_code: fix LambdaArg

This commit is contained in:
Astro 2021-12-06 21:58:25 +01:00
parent 00c3d33e79
commit 2db913eb15

View File

@ -68,7 +68,7 @@ fn scan(node: SyntaxNode<NixLanguage>, results: &mut Vec<DeadCode>) {
SyntaxKind::NODE_IDENT => { SyntaxKind::NODE_IDENT => {
let name = Ident::cast(arg.clone()) let name = Ident::cast(arg.clone())
.expect("Ident::cast"); .expect("Ident::cast");
if !find_usage(&name, node.clone()) { if !find_usage(&name, lambda.body().expect("lambda.body()")) {
results.push(DeadCode { results.push(DeadCode {
kind: BindingKind::LambdaArg, kind: BindingKind::LambdaArg,
name, name,