From 05a6532e1aece0f743a357372a8e2d5fd71273ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolphe=20Br=C3=A9ard?= Date: Sun, 13 Jun 2021 15:31:56 +0200 Subject: [PATCH] Use Option::map instead of custom match --- acmed/src/account/storage.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/acmed/src/account/storage.rs b/acmed/src/account/storage.rs index d759f28..46757fa 100644 --- a/acmed/src/account/storage.rs +++ b/acmed/src/account/storage.rs @@ -156,10 +156,10 @@ fn do_save(file_manager: &FileManager, account: &Account) -> Result<(), Error> { .iter() .map(|k| AccountKeyStorage::new(&k)) .collect::, Error>>()?; - let external_account = match &account.external_account { - Some(a) => Some(ExternalAccountStorage::new(&a)), - None => None, - }; + let external_account = account + .external_account + .as_ref() + .map(|a| ExternalAccountStorage::new(&a)); let account_storage = AccountStorage { name: account.name.to_owned(), endpoints,