rust/clippy_lints
bors d51db24132 Auto merge of #6660 - camsteffen:path-to-local, r=llogiq
Cleanup path-to-local checks

changelog: none

It seemed like too much ceremony going on to check if an expression matches a variable. So I created two util functions `path_to_local(Expr) -> Option<HirId>` and `path_to_local_id(Expr, HirId) -> bool` to make this easier, and used them wherever applicable.

I changed logic in a few places to use `HirId` instead of `Symbol` where it was easy to do so. I believe this is more correct and may even fix some bugs.

I also removed some calls to `qpath_res`. This is not needed if you are only looking for a `Res::Local`.

As a note, I wanted to name the util functions in a way that encourages understanding of the HIR.
2021-02-07 08:40:41 +00:00
..
src Auto merge of #6660 - camsteffen:path-to-local, r=llogiq 2021-02-07 08:40:41 +00:00
Cargo.toml Get rid of regex and lazy_static dependencies 2021-01-30 17:43:00 +01:00
README.md

This crate contains Clippy lints. For the main crate, check GitHub.