Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clippy needless_lifetimes lint #89

Merged

Conversation

FreezyLemon
Copy link
Contributor

needless_lifetimes seems to have been stabilized in 1.83. It correctly identifies completely unnecessary lifetimes, but also warns on cases like this:

warning: the following explicit lifetimes could be elided: 'a
  --> src/software/scaling/vector.rs:32:6
   |
32 | impl<'a> Vector<'a> {
   |      ^^         ^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
   |
32 - impl<'a> Vector<'a> {
32 + impl Vector<'_> {

I don't think this is an improvement, so unless rust-lang/rust-clippy#13514 or something similar is done, I'd just #![allow] it.

@shssoichiro
Copy link
Owner

I think I'd rather just allow it on a case-by-case basis if we need to. Definitely a matter of opinion though, so let me know how strongly you feel about globally allowing it.

@FreezyLemon
Copy link
Contributor Author

I'd usually prefer that, too. But seeing the latest CI run with ~100 errors only about this lint, it seems easier to just allow it globally. The worst code smell from this will be an unnecessary lifetime (see first commit in this PR), which I don't see as a big problem.

@shssoichiro
Copy link
Owner

Oh. That's a bit silly. Yeah, I don't think I care enough about clippy's opinion on this one.

@shssoichiro shssoichiro merged commit aa81e80 into shssoichiro:master Dec 5, 2024
20 checks passed
@FreezyLemon FreezyLemon deleted the resolve-new-clippy-lints branch December 6, 2024 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants