From fe4424496fc82a38f853c4a36acb39ccde03e5d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sosth=C3=A8ne=20Gu=C3=A9don?= Date: Wed, 25 Jan 2023 10:58:48 +0100 Subject: [PATCH] Remove unused items --- src/constants.rs | 1 - src/pipe.rs | 6 ------ src/types/packet.rs | 28 ++++++++-------------------- 3 files changed, 8 insertions(+), 27 deletions(-) diff --git a/src/constants.rs b/src/constants.rs index 4a82a7f..592f3ec 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -45,7 +45,6 @@ pub const MAX_IFSD: [u8; 4] = [0xfe, 0x00, 0x00, 0x00]; pub const MAX_MSG_LENGTH: usize = 3072; pub const MAX_MSG_LENGTH_LE: [u8; 4] = (MAX_MSG_LENGTH as u32).to_le_bytes(); -pub const NUM_SLOTS: u8 = 1; pub const MAX_BUSY_SLOTS: u8 = 1; // bPinSupport (0x0 = none, 0x01 = verification, 0x02 = modification) pub const PIN_SUPPORT: u8 = 0; diff --git a/src/pipe.rs b/src/pipe.rs index e8ec914..fc27a03 100644 --- a/src/pipe.rs +++ b/src/pipe.rs @@ -120,12 +120,6 @@ where atr } - - pub fn busy(&self) -> bool { - // need more states, but if we're waiting - // to send, we can't accept new packets - self.outbox.is_some() - } } impl<'bus, Bus, I, const N: usize> Pipe<'bus, Bus, I, N> diff --git a/src/types/packet.rs b/src/types/packet.rs index 27c1e8a..5782013 100644 --- a/src/types/packet.rs +++ b/src/types/packet.rs @@ -20,12 +20,6 @@ pub enum Error { UnknownCommand(u8), } -#[allow(clippy::large_enum_variant)] -pub enum Message { - Command(Command), - Response(Response), -} - pub trait Packet: core::ops::Deref { #[inline] fn slot(&self) -> u8 { @@ -151,16 +145,15 @@ pub enum CommandType { GetParameters = 0x6c, XfrBlock = 0x6f, Abort = 0x72, - // unsupported - ResetParameters = 0x6d, - SetParameters = 0x61, - Escape = 0x6b, // for vendor commands - IccClock = 0x7e, - T0Apdu = 0x6a, - Secure = 0x69, - Mechanical = 0x71, - SetDataRateAndClockFrequency = 0x73, + // ResetParameters = 0x6d, + // SetParameters = 0x61, + // Escape = 0x6b, // for vendor commands + // IccClock = 0x7e, + // T0Apdu = 0x6a, + // Secure = 0x69, + // Mechanical = 0x71, + // SetDataRateAndClockFrequency = 0x73, } macro_rules! command_message { @@ -318,11 +311,6 @@ impl Chain { } } -pub enum Response { - // DataBlock(DataBlock), - // SlotStatus(SlotStatus), -} - impl core::fmt::Debug for Command { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { let mut debug_struct = f.debug_struct("Command");