Fix warnings

This commit is contained in:
Sosthène Guédon
2024-03-01 14:29:40 +01:00
committed by Nicolas Stalder
parent 970cf482c8
commit 7dc87d3454
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -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);
+3 -3
View File
@@ -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
}