From c24f48a85aedb79261d3ec16678b17963cc0fe7d Mon Sep 17 00:00:00 2001 From: James Campos Date: Sat, 19 Jun 2021 12:53:45 -0700 Subject: clippy --- src/main.rs | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'src') 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> { // 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); -- cgit v1.2.3