From 1c4c9fda5c4f0b8ffb82dd0997bd62df051dcd88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sosth=C3=A8ne=20Gu=C3=A9don?= Date: Wed, 25 Jan 2023 10:56:47 +0100 Subject: [PATCH] Fix visibility All the internals of the crate were public. This patch makes a lot more private to allow evolution without everything being a breaking change --- src/constants.rs | 8 +++++--- src/lib.rs | 4 ++-- src/types.rs | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/constants.rs b/src/constants.rs index cf8acbe..4a82a7f 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -11,11 +11,13 @@ pub const SUBCLASS_NONE: u8 = 0x0; #[repr(u8)] pub enum TransferMode { - // bulk transfers, optional interrupt IN + /// bulk transfers, optional interrupt IN Bulk = 0, - // control transfers, no interrupt IN + /// control transfers, no interrupt IN + #[allow(unused)] ControlA = 1, - // control transfers, optional interrupt IN + /// control transfers, optional interrupt IN + #[allow(unused)] ControlB = 2, } diff --git a/src/lib.rs b/src/lib.rs index 96eb92a..3ffbfb9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -13,8 +13,8 @@ extern crate delog; generate_macros!(); pub mod class; -pub mod constants; -pub mod pipe; +mod constants; +mod pipe; pub mod types; // pub mod piv; diff --git a/src/types.rs b/src/types.rs index 5a8b350..2b12d2b 100644 --- a/src/types.rs +++ b/src/types.rs @@ -1,12 +1,12 @@ use embedded_time::duration::Milliseconds; // pub mod apdu; -pub mod packet; +pub(crate) mod packet; // pub type MessageBuffer = apdu_dispatch::interchanges::Data; #[derive(Copy, Clone, Debug, PartialEq, Eq)] -pub enum ClassRequest { +pub(crate) enum ClassRequest { Abort = 1, GetClockFrequencies = 2, GetDataRates = 3,