From 2de7c2bea2f5e330efc6362e33b7a284b559f352 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 6 Jul 2023 16:17:38 -0700 Subject: [PATCH] Resolve redundant_static_lifetimes clippy lint from PR 2471 error: constants have by default a `'static` lifetime --> serde/src/de/impls.rs:2467:24 | 2467 | pub const FIELDS: &'static [&'static str] = &["end"]; | -^^^^^^^--------------- help: consider removing `'static`: `&[&'static str]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes = note: `-D clippy::redundant-static-lifetimes` implied by `-D clippy::all` error: constants have by default a `'static` lifetime --> serde/src/de/impls.rs:2467:34 | 2467 | pub const FIELDS: &'static [&'static str] = &["end"]; | -^^^^^^^---- help: consider removing `'static`: `&str` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes error: constants have by default a `'static` lifetime --> serde/src/de/impls.rs:2605:24 | 2605 | pub const FIELDS: &'static [&'static str] = &["start"]; | -^^^^^^^--------------- help: consider removing `'static`: `&[&'static str]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes error: constants have by default a `'static` lifetime --> serde/src/de/impls.rs:2605:34 | 2605 | pub const FIELDS: &'static [&'static str] = &["start"]; | -^^^^^^^---- help: consider removing `'static`: `&str` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes --- serde/src/de/impls.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/serde/src/de/impls.rs b/serde/src/de/impls.rs index e0f6b60b..7cec26f6 100644 --- a/serde/src/de/impls.rs +++ b/serde/src/de/impls.rs @@ -1450,7 +1450,7 @@ macro_rules! variant_identifier { $($variant),* } - static $variants_name: &'static [&'static str] = &[$(stringify!($variant)),*]; + static $variants_name: &[&str] = &[$(stringify!($variant)),*]; impl<'de> Deserialize<'de> for $name_kind { fn deserialize(deserializer: D) -> Result @@ -2464,7 +2464,7 @@ mod range_from { use de::{Deserialize, Deserializer, Error, MapAccess, SeqAccess, Visitor}; - pub const FIELDS: &'static [&'static str] = &["end"]; + pub const FIELDS: &[&str] = &["end"]; // If this were outside of the serde crate, it would just use: // @@ -2602,7 +2602,7 @@ mod range_to { use de::{Deserialize, Deserializer, Error, MapAccess, SeqAccess, Visitor}; - pub const FIELDS: &'static [&'static str] = &["start"]; + pub const FIELDS: &[&str] = &["start"]; // If this were outside of the serde crate, it would just use: //