Fix most Clippy warnings.
This commit is contained in:
@@ -325,7 +325,7 @@ impl TryFrom<cbor::Value> for AuthenticatorClientPinParameters {
|
||||
let key_agreement = key_agreement
|
||||
.map(extract_map)
|
||||
.transpose()?
|
||||
.map(|x| CoseKey(x));
|
||||
.map(CoseKey);
|
||||
let pin_auth = pin_auth.map(extract_byte_string).transpose()?;
|
||||
let new_pin_enc = new_pin_enc.map(extract_byte_string).transpose()?;
|
||||
let pin_hash_enc = pin_hash_enc.map(extract_byte_string).transpose()?;
|
||||
|
||||
@@ -694,7 +694,7 @@ where
|
||||
key_id: credential.credential_id.clone(),
|
||||
transports: None, // You can set USB as a hint here.
|
||||
};
|
||||
let user = if (flags & UV_FLAG != 0) && (credential.user_handle.len() > 0) {
|
||||
let user = if (flags & UV_FLAG != 0) && !credential.user_handle.is_empty() {
|
||||
Some(PublicKeyCredentialUserEntity {
|
||||
user_id: credential.user_handle.clone(),
|
||||
user_name: None,
|
||||
|
||||
@@ -88,6 +88,7 @@ const _DEFAULT_MIN_PIN_LENGTH_RP_IDS: Vec<String> = Vec::new();
|
||||
#[cfg(feature = "with_ctap2_1")]
|
||||
const _MAX_RP_IDS_LENGTH: usize = 8;
|
||||
|
||||
#[allow(clippy::enum_variant_names)]
|
||||
#[derive(PartialEq, Eq, PartialOrd, Ord)]
|
||||
enum Key {
|
||||
// TODO(cretin): Test whether this doesn't consume too much memory. Otherwise, we can use less
|
||||
@@ -406,10 +407,11 @@ impl PersistentStore {
|
||||
data: pin_hash,
|
||||
sensitive: true,
|
||||
};
|
||||
Ok(match self.store.find_one(&Key::PinHash) {
|
||||
match self.store.find_one(&Key::PinHash) {
|
||||
None => self.store.insert(entry)?,
|
||||
Some((index, _)) => self.store.replace(index, entry)?,
|
||||
})
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn pin_retries(&self) -> Result<u8, Ctap2StatusCode> {
|
||||
|
||||
Reference in New Issue
Block a user