summaryrefslogtreecommitdiffstats
path: root/src/module.rs
diff options
context:
space:
mode:
author谢祯晖 <xiezh0831@126.com>2019-09-13 02:06:59 +0800
committerMatan Kushner <hello@matchai.me>2019-09-12 14:06:59 -0400
commita6c64e84579f6bd5bc457f05e13220c6ef9e50bc (patch)
treefec9557eb2d5952fcc63b57a04e72c2aa36b6adb /src/module.rs
parent2f94cac5b33ced1b804b92e6d9aa60787ef4c982 (diff)
feat: Implement threshold based styling for battery module (#318)
Diffstat (limited to 'src/module.rs')
-rw-r--r--src/module.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/module.rs b/src/module.rs
index 04233578a..c2f4580e1 100644
--- a/src/module.rs
+++ b/src/module.rs
@@ -145,6 +145,11 @@ impl<'a> Module<'a> {
pub fn config_value_style(&self, key: &str) -> Option<Style> {
self.config.and_then(|config| config.get_as_ansi_style(key))
}
+
+ /// Get a module's config value as an array
+ pub fn config_value_array(&self, key: &str) -> Option<&Vec<toml::Value>> {
+ self.config.and_then(|config| config.get_as_array(key))
+ }
}
impl<'a> fmt::Display for Module<'a> {