summaryrefslogtreecommitdiffstats
path: root/src/module.rs
diff options
context:
space:
mode:
authorKevin Song <chipbuster@users.noreply.github.com>2019-08-10 14:30:30 -0700
committerMatan Kushner <hello@matchai.me>2019-08-10 17:30:30 -0400
commit39598ec691387637e144799f2d8a983148fd0a57 (patch)
tree7843949bab665779b4a27e042e4d858628eaa5da /src/module.rs
parent994a865d4da6e67326e1f19094a507b6b226f225 (diff)
feat: Add configuration to change the character for non-zero sta… (#133)
Prompt can now switch characters in addition to switching character color. Add configuration options in so that users can do either, both, or neither.
Diffstat (limited to 'src/module.rs')
-rw-r--r--src/module.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/module.rs b/src/module.rs
index ade5d9e5d..4c5787573 100644
--- a/src/module.rs
+++ b/src/module.rs
@@ -44,7 +44,7 @@ impl<'a> Module<'a> {
let mut segment = Segment::new(name);
segment.set_style(self.style);
// Use the provided value unless overwritten by config
- segment.set_value(self.config_value(name).unwrap_or(value));
+ segment.set_value(self.config_value_str(name).unwrap_or(value));
self.segments.push(segment);
self.segments.last_mut().unwrap()
@@ -96,7 +96,7 @@ impl<'a> Module<'a> {
}
/// Get a module's config value as a string
- fn config_value(&self, key: &str) -> Option<&str> {
+ pub fn config_value_str(&self, key: &str) -> Option<&str> {
self.config.and_then(|config| config.get_as_str(key))
}