From ac655bbddbc2d29422eaa63be1f12cdd95fa0129 Mon Sep 17 00:00:00 2001 From: David Brown Date: Fri, 22 Oct 2021 16:33:27 -0600 Subject: [PATCH] sim: Functionalize the code a bit Instead of setting a mutable variable and possibly assigning to it, just set the variable to the result of the conditional. Signed-off-by: David Brown --- sim/src/image.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sim/src/image.rs b/sim/src/image.rs index 5ef0e57e..99ef786f 100644 --- a/sim/src/image.rs +++ b/sim/src/image.rs @@ -1658,10 +1658,7 @@ fn make_tlv() -> TlvGen { if Caps::EcdsaP224.present() { panic!("Ecdsa P224 not supported in Simulator"); } - let mut aes_key_size = 128; - if Caps::Aes256.present() { - aes_key_size = 256; - } + let aes_key_size = if Caps::Aes256.present() { 256 } else { 128 }; if Caps::EncKw.present() { if Caps::RSA2048.present() {