Merge "Replace if statement with call to Option::map"

This commit is contained in:
Treehugger Robot 2021-07-21 23:31:14 +00:00 committed by Gerrit Code Review
commit a68ba13323

View file

@ -126,10 +126,8 @@ impl SuperKeyIdentifier {
fn from_metadata(metadata: &BlobMetaData) -> Option<Self> { fn from_metadata(metadata: &BlobMetaData) -> Option<Self> {
if let Some(EncryptedBy::KeyId(key_id)) = metadata.encrypted_by() { if let Some(EncryptedBy::KeyId(key_id)) = metadata.encrypted_by() {
Some(SuperKeyIdentifier::DatabaseId(*key_id)) Some(SuperKeyIdentifier::DatabaseId(*key_id))
} else if let Some(boot_level) = metadata.max_boot_level() {
Some(SuperKeyIdentifier::BootLevel(*boot_level))
} else { } else {
None metadata.max_boot_level().map(|boot_level| SuperKeyIdentifier::BootLevel(*boot_level))
} }
} }