Open sivizius opened 2 months ago
I agree that this behavior seems inconsistent.
The LambdaArg case however is a bit special because it cannot be removed entirely. Renaming them to _
makes code less self-explanatory. I'd like to reconsider about that for a few days.
Against the alternative proposal, I think finding dead declarations that start with _
is very useful.
Due to https://github.com/astro/deadnix/blob/main/src/scope.rs#L105, lambda arguments starting with
_
are always allowed, even without--no-underscore
. This behaviour is different from other bindings, e.g.let _foo = 23; in …
, where--no-underscore
is necessary, and thus unexpected. I suggest to either change this toname.syntax().text() != "_"
or remove this flag and always allow symbols starting with_
, even in let-bindings, which is the default in many programming languages including rust.