Fix clippy warnings

This commit is contained in:
Sosthène Guédon
2024-03-01 14:29:40 +01:00
committed by Nicolas Stalder
parent 4892544fdc
commit 2f9ee62a28
2 changed files with 11 additions and 16 deletions
+9 -9
View File
@@ -58,7 +58,7 @@ impl Default for Options {
impl Options {
pub fn storage(self, storage: Location) -> Self {
Self { storage, ..self }
Self { storage }
}
}
@@ -493,17 +493,17 @@ impl<'a, T: trussed::Client + trussed::client::Ed255> LoadedAuthenticator<'a, T>
exponentiation: None,
} => self.mutual_auth_2(auth, r, c, reply.lend())?,
Auth {
witness,
challenge,
response,
exponentiation,
witness: _witness,
challenge: _challenge,
response: _response,
exponentiation: _exponentiation,
} => {
warn!(
"General authenticate with unexpected data: witness: {:?}, challenge: {:?}, response: {:?}, exponentiation: {:?}",
witness.map(|s|s.len()),
challenge.map(|s|s.len()),
response.map(|s|s.len()),
exponentiation.map(|s|s.len()),
_witness.map(|s|s.len()),
_challenge.map(|s|s.len()),
_response.map(|s|s.len()),
_exponentiation.map(|s|s.len()),
);
return Err(Status::IncorrectDataParameter);
}
+2 -7
View File
@@ -12,8 +12,9 @@ use serde::Deserialize;
use trussed::types::GenericArray;
// iso7816::Status doesn't support serde
#[derive(Deserialize, Debug, PartialEq, Clone, Copy)]
#[derive(Deserialize, Debug, PartialEq, Clone, Copy, Default)]
enum Status {
#[default]
Success,
MoreAvailable(u8),
VerificationFailed,
@@ -178,12 +179,6 @@ impl TryFrom<u16> for Status {
}
}
impl Default for Status {
fn default() -> Status {
Status::Success
}
}
#[derive(Deserialize, Debug)]
#[serde(deny_unknown_fields)]
struct IoTest {