From 26edaf3d125e5c0725a2076202945af4c89eb98f Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 10 Mar 2021 05:27:38 -0700 Subject: [PATCH] sim: Change a match with empty arm to if let This reads a little easier. Signed-off-by: David Brown --- sim/src/tlv.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sim/src/tlv.rs b/sim/src/tlv.rs index 32e006fd..b6c3c969 100644 --- a/sim/src/tlv.rs +++ b/sim/src/tlv.rs @@ -591,9 +591,8 @@ impl ManifestGen for TlvGen { fn generate_enc_key(&mut self) { let rng = rand::SystemRandom::new(); let mut buf = vec![0u8; AES_KEY_LEN]; - match rng.fill(&mut buf) { - Err(_) => panic!("Error generating encrypted key"), - Ok(_) => (), + if rng.fill(&mut buf).is_err() { + panic!("Error generating encrypted key"); } info!("New encryption key: {:02x?}", buf); self.enc_key = buf;