sim: Change a match with empty arm to if let
This reads a little easier. Signed-off-by: David Brown <david.brown@linaro.org>
This commit is contained in:
parent
f66b2050fa
commit
26edaf3d12
|
@ -591,9 +591,8 @@ impl ManifestGen for TlvGen {
|
||||||
fn generate_enc_key(&mut self) {
|
fn generate_enc_key(&mut self) {
|
||||||
let rng = rand::SystemRandom::new();
|
let rng = rand::SystemRandom::new();
|
||||||
let mut buf = vec![0u8; AES_KEY_LEN];
|
let mut buf = vec![0u8; AES_KEY_LEN];
|
||||||
match rng.fill(&mut buf) {
|
if rng.fill(&mut buf).is_err() {
|
||||||
Err(_) => panic!("Error generating encrypted key"),
|
panic!("Error generating encrypted key");
|
||||||
Ok(_) => (),
|
|
||||||
}
|
}
|
||||||
info!("New encryption key: {:02x?}", buf);
|
info!("New encryption key: {:02x?}", buf);
|
||||||
self.enc_key = buf;
|
self.enc_key = buf;
|
||||||
|
|
Loading…
Reference in New Issue