diff options
author | extrawurst <776816+extrawurst@users.noreply.github.com> | 2022-08-31 10:51:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-31 10:51:08 +0200 |
commit | 986d34a5acd520fbec91386675bec8013affc6bd (patch) | |
tree | 8b5ce329573e3e157d374472b2d16e7aaf5397ee /src/ui | |
parent | aa9ed3349fb69c55780fbd67aae5efdc9bc5a397 (diff) |
support opening submodule (#1298)
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/style.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ui/style.rs b/src/ui/style.rs index f59f1f41..3a33948f 100644 --- a/src/ui/style.rs +++ b/src/ui/style.rs @@ -15,7 +15,7 @@ use tui::style::{Color, Modifier, Style}; pub type SharedTheme = Rc<Theme>; -#[derive(Serialize, Deserialize, Debug)] +#[derive(Serialize, Deserialize, Debug, Copy, Clone)] pub struct Theme { selected_tab: Color, #[serde(with = "Color")] @@ -279,7 +279,7 @@ impl Theme { } // This will only be called when theme.ron doesn't already exists - fn save(&self, theme_file: PathBuf) -> Result<()> { + fn save(&self, theme_file: &PathBuf) -> Result<()> { let mut file = File::create(theme_file)?; let data = to_string_pretty(self, PrettyConfig::default())?; file.write_all(data.as_bytes())?; @@ -293,7 +293,7 @@ impl Theme { Ok(from_bytes(&buffer)?) } - pub fn init(file: PathBuf) -> Result<Self> { + pub fn init(file: &PathBuf) -> Result<Self> { if file.exists() { match Self::read_file(file.clone()) { Err(e) => { |