mirror of
https://github.com/Djeeberjr/fw-anwesenheit.git
synced 2025-10-13 15:06:39 +00:00
added TryFrom<[u8;12]> to TallyID
This commit is contained in:
parent
f46cdc4d29
commit
99848f0e6d
@ -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 {
|
impl Display for TallyID {
|
||||||
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
|
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
|
||||||
let s: heapless::String<12> = (*self).into();
|
let s: heapless::String<12> = (*self).into();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user