summaryrefslogtreecommitdiffstats
path: root/src/config/theme.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/config/theme.rs')
-rw-r--r--src/config/theme.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/config/theme.rs b/src/config/theme.rs
index 31ccbdc..5de537c 100644
--- a/src/config/theme.rs
+++ b/src/config/theme.rs
@@ -153,7 +153,14 @@ pub struct JoshutoTheme {
}
impl JoshutoTheme {
- pub fn new() -> Self {
+ pub fn get_config() -> JoshutoTheme {
+ parse_config_file::<JoshutoRawTheme, JoshutoTheme>(crate::THEME_FILE)
+ .unwrap_or_else(JoshutoTheme::default)
+ }
+}
+
+impl std::default::Default for JoshutoTheme {
+ fn default() -> Self {
let mut colorpair: Vec<JoshutoColorPair> = Vec::with_capacity(10);
colorpair.push(JoshutoColorPair::new(2, 2, -1));
colorpair.push(JoshutoColorPair::new(3, 3, -1));
@@ -220,9 +227,4 @@ impl JoshutoTheme {
ext: HashMap::new(),
}
}
-
- pub fn get_config() -> JoshutoTheme {
- parse_config_file::<JoshutoRawTheme, JoshutoTheme>(crate::THEME_FILE)
- .unwrap_or_else(JoshutoTheme::new)
- }
}