added TryFrom<[u8;12]> to TallyID

This commit is contained in:
Djeeberjr 2025-10-11 14:47:29 +02:00
parent f46cdc4d29
commit 99848f0e6d

View File

@ -72,6 +72,14 @@ impl TryFrom<&[u8]> for TallyID {
}
}
impl TryFrom<[u8; 12]> for TallyID {
type Error = ();
fn try_from(value: [u8; 12]) -> Result<Self, Self::Error> {
Self::try_from(&value as &[u8])
}
}
impl Display for TallyID {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
let s: heapless::String<12> = (*self).into();