mirror of
https://github.com/trussed-dev/piv-authenticator.git
synced 2026-06-20 04:16:15 -07:00
Fix warnings
This commit is contained in:
committed by
Nicolas Stalder
parent
970cf482c8
commit
7dc87d3454
+1
-1
@@ -47,7 +47,7 @@ pub fn expect_tag_and_get_value<'a>(input: &mut Reader<'a>, tag: u8) -> Result<I
|
||||
}
|
||||
|
||||
/// Read a tag and its value. Errors when the expected and actual tag and values do not match.
|
||||
pub fn expect_tag_and_value<'a>(input: &mut Reader<'a>, tag: u8, value: &[u8]) -> Result<()> {
|
||||
pub fn expect_tag_and_value(input: &mut Reader, tag: u8, value: &[u8]) -> Result<()> {
|
||||
let (actual_tag, inner) = read_tag_and_get_value(input)?;
|
||||
if usize::from(tag) != usize::from(actual_tag) {
|
||||
return Err(Error::WrongTag);
|
||||
|
||||
@@ -365,7 +365,7 @@ impl IoCmd {
|
||||
expected_status: Status,
|
||||
card: &mut setup::Piv,
|
||||
) -> heapless::Vec<u8, 1024> {
|
||||
println!("Command: {:x?}", input);
|
||||
println!("Command: {input:x?}");
|
||||
let mut rep: heapless::Vec<u8, 1024> = heapless::Vec::new();
|
||||
let cmd: iso7816::Command<{ setup::COMMAND_SIZE }> = iso7816::Command::try_from(input)
|
||||
.unwrap_or_else(|err| {
|
||||
@@ -380,10 +380,10 @@ impl IoCmd {
|
||||
println!("Output: {:?}\nStatus: {status:?}", hex::encode(&rep));
|
||||
|
||||
if !output.validate(&rep) {
|
||||
panic!("Bad output. Expected {:02x?}", output);
|
||||
panic!("Bad output. Expected {output:02x?}");
|
||||
}
|
||||
if status != expected_status {
|
||||
panic!("Bad status. Expected {:?}", expected_status);
|
||||
panic!("Bad status. Expected {expected_status:?}");
|
||||
}
|
||||
rep
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user