diff options
author | James Campos <james.r.campos@gmail.com> | 2021-06-19 12:53:45 -0700 |
---|---|---|
committer | James Campos <james.r.campos@gmail.com> | 2021-06-19 12:53:45 -0700 |
commit | c24f48a85aedb79261d3ec16678b17963cc0fe7d (patch) | |
tree | 59333878c1baa72f82c7f43bae49246be9a8ea38 /src | |
parent | 417c5d258c8a80790b848882e4b92dc2b5ae5f63 (diff) | |
download | bk-c24f48a85aedb79261d3ec16678b17963cc0fe7d.tar.gz |
clippy
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/main.rs b/src/main.rs index e23896c..4ed14b2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -363,22 +363,18 @@ fn init() -> Result<State, Box<dyn std::error::Error>> { // XXX oh god what let fg = args .fg - .and_then(|s| { - Some(Rgb { - r: u8::from_str_radix(&s[0..2], 16).unwrap(), - g: u8::from_str_radix(&s[2..4], 16).unwrap(), - b: u8::from_str_radix(&s[4..6], 16).unwrap(), - }) + .map(|s| Rgb { + r: u8::from_str_radix(&s[0..2], 16).unwrap(), + g: u8::from_str_radix(&s[2..4], 16).unwrap(), + b: u8::from_str_radix(&s[4..6], 16).unwrap(), }) .unwrap_or(style::Color::Reset); let bg = args .bg - .and_then(|s| { - Some(Rgb { - r: u8::from_str_radix(&s[0..2], 16).unwrap(), - g: u8::from_str_radix(&s[2..4], 16).unwrap(), - b: u8::from_str_radix(&s[4..6], 16).unwrap(), - }) + .map(|s| Rgb { + r: u8::from_str_radix(&s[0..2], 16).unwrap(), + g: u8::from_str_radix(&s[2..4], 16).unwrap(), + b: u8::from_str_radix(&s[4..6], 16).unwrap(), }) .unwrap_or(style::Color::Reset); |