From 7dc87d34548b6847d6440b84ce2fdfd56acee7c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sosth=C3=A8ne=20Gu=C3=A9don?= Date: Wed, 8 Feb 2023 15:46:01 +0100 Subject: [PATCH] Fix warnings --- src/derp.rs | 2 +- tests/command_response.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/derp.rs b/src/derp.rs index 9a58b7d..0906780 100644 --- a/src/derp.rs +++ b/src/derp.rs @@ -47,7 +47,7 @@ pub fn expect_tag_and_get_value<'a>(input: &mut Reader<'a>, tag: u8) -> Result(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); diff --git a/tests/command_response.rs b/tests/command_response.rs index 2f114d4..9c3334d 100644 --- a/tests/command_response.rs +++ b/tests/command_response.rs @@ -365,7 +365,7 @@ impl IoCmd { expected_status: Status, card: &mut setup::Piv, ) -> heapless::Vec { - println!("Command: {:x?}", input); + println!("Command: {input:x?}"); let mut rep: heapless::Vec = 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 }