aboutsummaryrefslogtreecommitdiffstats
path: root/src/colors.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2018-02-19 21:02:10 -0500
committerJesse Luehrs <doy@tozt.net>2018-02-19 21:10:12 -0500
commit56f830f0b61cc47875bfbf4c0daad6fd5887a450 (patch)
tree415e25c1453d4ceade9873da055b7a14efd3cae5 /src/colors.rs
parent0b3404a16019757c891b153485f0583c49f7089f (diff)
downloadfancy-prompt-56f830f0b61cc47875bfbf4c0daad6fd5887a450.tar.gz
fancy-prompt-56f830f0b61cc47875bfbf4c0daad6fd5887a450.zip
simplify, and implement autosizing
Diffstat (limited to 'src/colors.rs')
-rw-r--r--src/colors.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/colors.rs b/src/colors.rs
index 09492e3..5049392 100644
--- a/src/colors.rs
+++ b/src/colors.rs
@@ -28,14 +28,14 @@ impl Colors {
pub fn new(shell_type: ShellType) -> Colors {
let mut color_map = std::collections::HashMap::new();
- color_map.insert("battery_warn".to_string(), term::color::YELLOW);
- color_map.insert("battery_crit".to_string(), term::color::RED);
- color_map.insert("battery_emerg".to_string(), term::color::BRIGHT_RED);
- color_map.insert("battery_full".to_string(), term::color::GREEN);
- color_map.insert("battery_charging".to_string(), term::color::GREEN);
-
- color_map.insert("default".to_string(), term::color::BRIGHT_BLACK);
- color_map.insert("error".to_string(), term::color::RED);
+ color_map.insert(String::from("battery_warn"), term::color::YELLOW);
+ color_map.insert(String::from("battery_crit"), term::color::RED);
+ color_map.insert(String::from("battery_emerg"), term::color::BRIGHT_RED);
+ color_map.insert(String::from("battery_full"), term::color::GREEN);
+ color_map.insert(String::from("battery_charging"), term::color::GREEN);
+
+ color_map.insert(String::from("default"), term::color::BRIGHT_BLACK);
+ color_map.insert(String::from("error"), term::color::RED);
let unknown_color = term::color::YELLOW;