From 98fc2477acc070a0ca660968ef90744f3c2e9bf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sosth=C3=A8ne=20Gu=C3=A9don?= Date: Tue, 25 Oct 2022 10:22:23 +0200 Subject: [PATCH] Use recent method for macro import --- src/constants.rs | 2 ++ src/container.rs | 2 ++ src/lib.rs | 3 --- src/piv_types.rs | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/constants.rs b/src/constants.rs index 84ceb4b..8426c9a 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -1,5 +1,7 @@ // https://developers.yubico.com/PIV/Introduction/Yubico_extensions.html +use hex_literal::hex; + pub const RID_LENGTH: usize = 5; // top nibble of first byte is "category", here "A" = International diff --git a/src/container.rs b/src/container.rs index dfc3a0d..f211a78 100644 --- a/src/container.rs +++ b/src/container.rs @@ -1,4 +1,6 @@ use core::convert::TryFrom; + +use hex_literal::hex; // use flexiber::{Decodable, Encodable}; pub struct Tag<'a>(&'a [u8]); diff --git a/src/lib.rs b/src/lib.rs index e4af02e..304e82c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,9 +7,6 @@ extern crate log; #[cfg(feature = "delog")] delog::generate_macros!(); -#[macro_use(hex)] -extern crate hex_literal; - pub mod commands; pub use commands::Command; pub mod constants; diff --git a/src/piv_types.rs b/src/piv_types.rs index 65d72fd..8b4eaf8 100644 --- a/src/piv_types.rs +++ b/src/piv_types.rs @@ -1,6 +1,7 @@ use core::convert::{TryFrom, TryInto}; use flexiber::Encodable; +use hex_literal::hex; use serde::{Deserialize, Serialize}; /// According to spec, a PIN must be 6-8 digits, padded to 8 bytes with 0xFF.