Skip to content

Commit

Permalink
simplify matches
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas-Avery committed Jul 17, 2024
1 parent f40009e commit 70f7a17
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions crates/bws/src/command/secret.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 70f7a17

Please sign in to comment.