Skip to content

Clippy warning: needless lifetimesΒ #895

@robamu

Description

@robamu

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions