From 83a48456838f42657663d2d3491c60517342e453 Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Thu, 3 Jun 2021 11:49:47 +0200 Subject: [PATCH] main: fix some clippy warnings --- src/main.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index eb869d0..14f6f76 100644 --- a/src/main.rs +++ b/src/main.rs @@ -243,10 +243,9 @@ fn main() -> Result<(), String> { unstable_karma, update_type, } => { - let builds: Option> = match &builds { - Some(builds) => Some(builds.iter().map(|b| b.as_str()).collect()), - None => None, - }; + let builds: Option> = builds + .as_ref() + .map(|builds| builds.iter().map(|b| b.as_str()).collect()); let mut builder = match (&builds, &from_tag) { (Some(_), Some(_)) => unreachable!(), @@ -410,10 +409,7 @@ fn main() -> Result<(), String> { } }; - let requirements = match &requirements { - Some(reqs) => Some(reqs.join(",")), - None => None, - }; + let requirements = requirements.as_ref().map(|reqs| reqs.join(",")); if let Some(requirements) = &requirements { editor = editor.requirements(&requirements); }