diff --git a/gen/src/airline.rs b/gen/src/airline.rs index 0770ba5..7eb8999 100644 --- a/gen/src/airline.rs +++ b/gen/src/airline.rs @@ -13,7 +13,7 @@ struct ModeColors<'a> { #[derive(Debug)] pub struct AirlineTheme<'a> { - palette: &'a Palette, + palette: &'a Palette<'a>, modes: HashMap<&'a str, ModeColors<'a>>, paste: &'a str, info_mod: &'a str, diff --git a/gen/src/alacritty.rs b/gen/src/alacritty.rs index 74ac3cc..d39f250 100644 --- a/gen/src/alacritty.rs +++ b/gen/src/alacritty.rs @@ -37,7 +37,7 @@ type Color<'a> = (&'a str, &'a str); // Pair of foreground/background colors #[derive(Debug)] pub struct AlacrittyTheme<'a> { - palette: &'a Palette, + palette: &'a Palette<'a>, background: &'a str, dim: AnsiColors<'a>, normal: AnsiColors<'a>, diff --git a/gen/src/colorscheme.rs b/gen/src/colorscheme.rs index 84e78ec..dff145f 100644 --- a/gen/src/colorscheme.rs +++ b/gen/src/colorscheme.rs @@ -39,7 +39,7 @@ fn indent(level: u8) -> &'static str { #[derive(Debug)] pub struct Colorscheme<'a> { - palette: &'a Palette, + palette: &'a Palette<'a>, highlights: &'a [Highlight], term_colors: [&'static str; 16], } diff --git a/gen/src/palette.rs b/gen/src/palette.rs index a48586b..fbf1c2f 100644 --- a/gen/src/palette.rs +++ b/gen/src/palette.rs @@ -3,8 +3,8 @@ use std::fmt::Display; use std::ops::Deref; #[derive(Debug, PartialEq)] -pub struct Color { - pub gui: ColorCode<&'static str>, +pub struct Color<'a> { + pub gui: ColorCode<&'a str>, pub cterm: ColorCode, } @@ -23,26 +23,26 @@ impl ColorCode { } } -type Colors = HashMap<&'static str, Color>; +type Colors<'a> = HashMap<&'a str, Color<'a>>; #[derive(Debug)] -pub struct Palette(Colors); +pub struct Palette<'a>(Colors<'a>); -impl Deref for Palette { - type Target = Colors; +impl<'a> Deref for Palette<'a> { + type Target = Colors<'a>; fn deref(&self) -> &Self::Target { &self.0 } } -impl From for Palette { - fn from(m: Colors) -> Self { +impl<'a> From> for Palette<'a> { + fn from(m: Colors<'a>) -> Self { Self(m) } } -impl Default for Palette { +impl<'a> Default for Palette<'a> { #[rustfmt::skip] fn default() -> Self { use ColorCode::{Normal, Contrast};