Skip to content

Commit 26edaf3

Browse files
committed
sim: Change a match with empty arm to if let
This reads a little easier. Signed-off-by: David Brown <david.brown@linaro.org>
1 parent f66b205 commit 26edaf3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

sim/src/tlv.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -591,9 +591,8 @@ impl ManifestGen for TlvGen {
591591
fn generate_enc_key(&mut self) {
592592
let rng = rand::SystemRandom::new();
593593
let mut buf = vec![0u8; AES_KEY_LEN];
594-
match rng.fill(&mut buf) {
595-
Err(_) => panic!("Error generating encrypted key"),
596-
Ok(_) => (),
594+
if rng.fill(&mut buf).is_err() {
595+
panic!("Error generating encrypted key");
597596
}
598597
info!("New encryption key: {:02x?}", buf);
599598
self.enc_key = buf;

0 commit comments

Comments
 (0)