[pve-devel] [PATCH proxmox-ve-rs] clippy: elide some lifetimes

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Apr 4 18:50:53 CEST 2025


Am 31.03.25 um 15:40 schrieb Gabriel Goller:
> Elide some lifetimes to avoid clippy warnings:
> 
>     warning: the following explicit lifetimes could be elided: 'a
>        --> proxmox-ve-config/src/firewall/parse.rs:319:11
>         |
>     319 | impl<'de, 'a, E> serde::de::Deserializer<'de> for SomeStrDeserializer<'a, E>
>         |           ^^                                                          ^^
>         |
>         = 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
>         |
>     319 - impl<'de, 'a, E> serde::de::Deserializer<'de> for SomeStrDeserializer<'a, E>
>     319 + impl<'de, E> serde::de::Deserializer<'de> for SomeStrDeserializer<'_, E>
>         |
> 
>     warning: the following explicit lifetimes could be elided: 'de
>        --> proxmox-ve-config/src/firewall/parse.rs:382:6
>         |
>     382 | impl<'de, 'a, E> serde::de::IntoDeserializer<'de, E> for SomeStr<'a>
>         |      ^^^                                     ^^^
>         |
>         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
>     help: elide the lifetimes
>         |
>     382 - impl<'de, 'a, E> serde::de::IntoDeserializer<'de, E> for SomeStr<'a>
>     382 + impl<'a, E> serde::de::IntoDeserializer<'_, E> for SomeStr<'a>
>         |
> 
>     warning: the following explicit lifetimes could be elided: 'de
>        --> proxmox-ve-config/src/firewall/parse.rs:468:6
>         |
>     468 | impl<'de, E> serde::de::IntoDeserializer<'de, E> for SomeString
>         |      ^^^                                 ^^^
>         |
>         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
>     help: elide the lifetimes
>         |
>     468 - impl<'de, E> serde::de::IntoDeserializer<'de, E> for SomeString
>     468 + impl<E> serde::de::IntoDeserializer<'_, E> for SomeString
>         |

please don't add that verbose and rather useless stuff to commit messages

And I applied the one from Christoph already, not because of above,
but simply because I read that first – but from a commit message POV
I definitively favor his one.

https://git.proxmox.com/?p=proxmox-ve-rs.git;a=commitdiff;h=1386a82556a9dfb42b0ec101cc3cf52d41848a0c




More information about the pve-devel mailing list