implement MAC auth for felica
This commit is contained in:
+4
-7
@@ -15,15 +15,12 @@ pub struct Uid {
|
||||
impl core::fmt::Display for Uid {
|
||||
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
|
||||
#[cfg(feature = "alloc")]
|
||||
return write!(f, "{}", hex::encode(&self.bytes));
|
||||
{
|
||||
write!(f, "{}", hex::encode(&self.bytes))
|
||||
}
|
||||
#[cfg(not(feature = "alloc"))]
|
||||
{
|
||||
let mut buf: heapless::Vec<u8, 14> = heapless::Vec::new();
|
||||
hex::encode_to_slice(&self.bytes, &mut buf)
|
||||
.map_err(|_| core::fmt::Error)?;
|
||||
let s = heapless::String::from_utf8(buf)
|
||||
.map_err(|_| core::fmt::Error)?;
|
||||
write!(f, "{}", s)
|
||||
write!(f, "{:?}", self)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user