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

Clippy warning: needless lifetimes #895

Closed
robamu opened this issue Jan 10, 2025 · 1 comment Β· Fixed by #897
Closed

Clippy warning: needless lifetimes #895

robamu opened this issue Jan 10, 2025 · 1 comment Β· Fixed by #897

Comments

@robamu
Copy link
Contributor

robamu commented Jan 10, 2025

I received this clippy error for a PAC generated with svd2rust v0.35.0:

va108xx-rs on ξ‚  some-clippy-fixes [$+] via 🐍 v3.12.3 (venv) via πŸ¦€ v1.84.0
❯ cargo clippy
   Compiling va108xx v0.3.0 (/home/rmueller/Rust/va108xx-rs/va108xx)
warning: the following explicit lifetimes could be elided: 'a
   --> va108xx/src/generic.rs:209:6
    |
209 | impl<'a, REG, const WI: u8, FI, Safety> FieldWriter<'a, REG, WI, FI, Safety>
    |      ^^                                             ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
    = note: `#[warn(clippy::needless_lifetimes)]` on by default
help: elide the lifetimes
    |
209 - impl<'a, REG, const WI: u8, FI, Safety> FieldWriter<'a, REG, WI, FI, Safety>
209 + impl<REG, const WI: u8, FI, Safety> FieldWriter<'_, REG, WI, FI, Safety>
    |

warning: `va108xx` (lib) generated 1 warning (run `cargo clippy --fix --lib -p va108xx` to apply 1 suggestion)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.50s

clippy version: 0.1.84
rust version: rustc 1.84.0

@robamu robamu changed the title Clippy error Clippy error: needless lifetimes Jan 10, 2025
@robamu robamu changed the title Clippy error: needless lifetimes Clippy warning: needless lifetimes Jan 10, 2025
@burrbull
Copy link
Member

If this works well on rust 1.76 (MSRV), please make PR.

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 a pull request may close this issue.

2 participants