diff --git a/src/tlv.rs b/src/tlv.rs index 372216c4..4d945199 100644 --- a/src/tlv.rs +++ b/src/tlv.rs @@ -69,7 +69,7 @@ pub fn take_len(data: &[u8]) -> Option<(usize, &[u8])> { let l2 = *data.get(1)?; let l3 = *data.get(2)?; let len = u16::from_be_bytes([l2, l3]) as usize; - Some((len as usize, &data[3..])) + Some((len, &data[3..])) } } diff --git a/tests/command-response.rs b/tests/command-response.rs index 6a8fcdbf..0d0ef982 100644 --- a/tests/command-response.rs +++ b/tests/command-response.rs @@ -294,7 +294,7 @@ impl Default for OutputMatcher { fn parse_hex(data: &str) -> Vec { let tmp: String = data.split_whitespace().collect(); - hex::decode(&tmp).unwrap() + hex::decode(tmp).unwrap() } impl OutputMatcher { @@ -417,7 +417,7 @@ impl IoCmd { println!("Command: {:x?}", input); let mut rep: heapless::Vec = heapless::Vec::new(); let cmd: iso7816::Command<1024> = iso7816::Command::try_from(input).unwrap_or_else(|err| { - panic!("Bad command: {err:?}, for command: {}", hex::encode(&input)) + panic!("Bad command: {err:?}, for command: {}", hex::encode(input)) }); let status: Status = card .handle(&cmd, &mut rep)