From 70f7a17ce1f98fde60a29a37edb509dfc2a2dbbf Mon Sep 17 00:00:00 2001 From: Thomas Avery Date: Wed, 17 Jul 2024 11:09:49 -0500 Subject: [PATCH] simplify matches --- crates/bws/src/command/secret.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/crates/bws/src/command/secret.rs b/crates/bws/src/command/secret.rs index 5ba20aa1e..0f1aa3981 100644 --- a/crates/bws/src/command/secret.rs +++ b/crates/bws/src/command/secret.rs @@ -171,13 +171,10 @@ pub(crate) async fn edit( key: secret.key.unwrap_or(old_secret.key), value: secret.value.unwrap_or(old_secret.value), note: secret.note.unwrap_or(old_secret.note), - project_ids: match secret.project_id { - Some(id) => Some(vec![id]), - None => match old_secret.project_id { - Some(id) => Some(vec![id]), - None => None, - }, - }, + project_ids: secret + .project_id + .or(old_secret.project_id) + .map(|id| vec![id]), }) .await?; serialize_response(new_secret, output_settings);