Skip to content

Commit

Permalink
Add missing 'static lifetimes to constant slices
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Nov 12, 2023
1 parent 93416cb commit f98627a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/lazy/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ enum Color {
}

impl Color {
const ALL: &[Color] = &[
const ALL: &'static [Color] = &[
Color::Black,
Color::Red,
Color::Orange,
Expand Down
3 changes: 2 additions & 1 deletion examples/modal/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ enum Plan {
}

impl Plan {
pub const ALL: &[Self] = &[Self::Basic, Self::Pro, Self::Enterprise];
pub const ALL: &'static [Self] =
&[Self::Basic, Self::Pro, Self::Enterprise];
}

impl fmt::Display for Plan {
Expand Down
2 changes: 1 addition & 1 deletion examples/toast/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ mod toast {
}

impl Status {
pub const ALL: &[Self] =
pub const ALL: &'static [Self] =
&[Self::Primary, Self::Secondary, Self::Success, Self::Danger];
}

Expand Down
2 changes: 1 addition & 1 deletion highlighter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ pub enum Theme {
}

impl Theme {
pub const ALL: &[Self] = &[
pub const ALL: &'static [Self] = &[
Self::SolarizedDark,
Self::Base16Mocha,
Self::Base16Ocean,
Expand Down

0 comments on commit f98627a

Please sign in to comment.