From 642925ba64fd54a73c94c37353ad6b0a7a7e4a7d Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Thu, 13 Aug 2020 09:31:03 +0200 Subject: [PATCH] readability cleanup Signed-off-by: Wolfgang Bumiller --- src/commands.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/commands.rs b/src/commands.rs index c59ee1b..781973a 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -101,15 +101,13 @@ pub(crate) fn check_last_encryption_mode( ) -> bool { match manifest.lookup_file_info(&archive_name(device_name)) { Ok(file) => { - match file.crypt_mode { - CryptMode::Encrypt => match crypt_mode { - CryptMode::Encrypt => true, - _ => false, - }, - CryptMode::SignOnly | CryptMode::None => match crypt_mode { - CryptMode::Encrypt => false, - _ => true, - }, + match (file.crypt_mode, crypt_mode) { + (CryptMode::Encrypt, CryptMode::Encrypt) => true, + (CryptMode::Encrypt, _) => false, + (CryptMode::SignOnly, CryptMode::Encrypt) => false, + (CryptMode::SignOnly, _) => true, + (CryptMode::None, CryptMode::Encrypt) => false, + (CryptMode::None, _) => true, } }, _ => false, -- 2.39.5