feat: bugs and feats (ambiguous)
This commit is contained in:
parent
d4a57edd95
commit
9865fd21ce
5 changed files with 53 additions and 77 deletions
|
|
@ -12,6 +12,12 @@ impl Identifier {
|
|||
}
|
||||
}
|
||||
|
||||
impl Default for Identifier {
|
||||
fn default() -> Self {
|
||||
Identifier::from(0x00000000)
|
||||
}
|
||||
}
|
||||
|
||||
impl Display for Identifier {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
write!(
|
||||
|
|
@ -35,9 +41,9 @@ impl LowerHex for Identifier {
|
|||
impl From<&[u8]> for Identifier {
|
||||
fn from(value: &[u8]) -> Self {
|
||||
let mut bytes = [0_u8; 4];
|
||||
bytes[..value.len()].copy_from_slice(value);
|
||||
bytes[..4].copy_from_slice(value[..4].as_ref());
|
||||
Identifier {
|
||||
bytes: [bytes[0], bytes[1], bytes[2], bytes[3]],
|
||||
bytes
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue