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 <david.brown@linaro.org>
This commit is contained in:
David Brown 2021-10-22 16:33:27 -06:00 committed by David Brown
parent 0bd8c6bf2a
commit ac655bbddb
1 changed files with 1 additions and 4 deletions

View File

@ -1658,10 +1658,7 @@ fn make_tlv() -> TlvGen {
if Caps::EcdsaP224.present() { if Caps::EcdsaP224.present() {
panic!("Ecdsa P224 not supported in Simulator"); panic!("Ecdsa P224 not supported in Simulator");
} }
let mut aes_key_size = 128; let aes_key_size = if Caps::Aes256.present() { 256 } else { 128 };
if Caps::Aes256.present() {
aes_key_size = 256;
}
if Caps::EncKw.present() { if Caps::EncKw.present() {
if Caps::RSA2048.present() { if Caps::RSA2048.present() {