aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJames Campos <james.r.campos@gmail.com>2021-06-19 12:53:45 -0700
committerJames Campos <james.r.campos@gmail.com>2021-06-19 12:53:45 -0700
commitc24f48a85aedb79261d3ec16678b17963cc0fe7d (patch)
tree59333878c1baa72f82c7f43bae49246be9a8ea38 /src
parent417c5d258c8a80790b848882e4b92dc2b5ae5f63 (diff)
downloadbk-c24f48a85aedb79261d3ec16678b17963cc0fe7d.tar.gz
clippy
Diffstat (limited to 'src')
-rw-r--r--src/main.rs20
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);