summaryrefslogtreecommitdiffstats
path: root/src/modules/character.rs
diff options
context:
space:
mode:
authorMatan Kushner <hello@matchai.me>2019-04-12 17:49:20 -0400
committerMatan Kushner <hello@matchai.me>2019-04-12 17:49:20 -0400
commitd82ebc4457adefcd9ad45c4d3d6d611c28d80cc3 (patch)
tree1b110727e2857bb3101ffd60ab8b881eb5c2cdc5 /src/modules/character.rs
parent7356faaec2cdb99abd662f33d716ab6387d4f48f (diff)
Add builder pattern for segment
Diffstat (limited to 'src/modules/character.rs')
-rw-r--r--src/modules/character.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/modules/character.rs b/src/modules/character.rs
index 4c83c5096..98b9b254e 100644
--- a/src/modules/character.rs
+++ b/src/modules/character.rs
@@ -15,8 +15,10 @@ pub fn segment(args: &ArgMatches) -> Segment {
const COLOR_SUCCESS: Color = Color::Green;
const COLOR_FAILURE: Color = Color::Red;
+ let segment = Segment::new("char");
+
let color = if args.value_of("status_code").unwrap() == "0" {
- COLOR_SUCCESS
+ segment.set_style(COLOR_SUCCESS);
} else {
COLOR_FAILURE
};