Skip to content

Commit 2de7c2b

Browse files
committed
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
1 parent e6a4a37 commit 2de7c2b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

serde/src/de/impls.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,7 +1450,7 @@ macro_rules! variant_identifier {
14501450
$($variant),*
14511451
}
14521452

1453-
static $variants_name: &'static [&'static str] = &[$(stringify!($variant)),*];
1453+
static $variants_name: &[&str] = &[$(stringify!($variant)),*];
14541454

14551455
impl<'de> Deserialize<'de> for $name_kind {
14561456
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
@@ -2464,7 +2464,7 @@ mod range_from {
24642464

24652465
use de::{Deserialize, Deserializer, Error, MapAccess, SeqAccess, Visitor};
24662466

2467-
pub const FIELDS: &'static [&'static str] = &["end"];
2467+
pub const FIELDS: &[&str] = &["end"];
24682468

24692469
// If this were outside of the serde crate, it would just use:
24702470
//
@@ -2602,7 +2602,7 @@ mod range_to {
26022602

26032603
use de::{Deserialize, Deserializer, Error, MapAccess, SeqAccess, Visitor};
26042604

2605-
pub const FIELDS: &'static [&'static str] = &["start"];
2605+
pub const FIELDS: &[&str] = &["start"];
26062606

26072607
// If this were outside of the serde crate, it would just use:
26082608
//

0 commit comments

Comments
 (0)