Fix clippy lints

This commit is contained in:
Jack Grigg
2021-04-04 16:55:34 +12:00
parent 3ea2463c3c
commit f74dd2ec4b
3 changed files with 15 additions and 19 deletions
+2 -6
View File
@@ -78,13 +78,9 @@ impl IdentityBuilder {
let keys = Key::list(yubikey)?;
USABLE_SLOTS
.iter()
.find(|&&slot| {
keys.iter()
.find(|key| key.slot() == SlotId::Retired(slot))
.is_none()
})
.find(|&&slot| !keys.iter().any(|key| key.slot() == SlotId::Retired(slot)))
.cloned()
.ok_or(Error::NoEmptySlots(yubikey.serial()))?
.ok_or_else(|| Error::NoEmptySlots(yubikey.serial()))?
}
};