refactor: node
This commit is contained in:
parent
bd9ce9f01f
commit
812748981a
8 changed files with 10 additions and 104 deletions
|
@ -41,8 +41,12 @@ impl LowerHex for Identifier {
|
|||
|
||||
impl From<&[u8]> for Identifier {
|
||||
fn from(value: &[u8]) -> Self {
|
||||
let mut bytes = [0_u8; 4];
|
||||
bytes[..4].copy_from_slice(value[..4].as_ref());
|
||||
let mut bytes = [0; 4];
|
||||
for i in 0..4 {
|
||||
if i < value.len() {
|
||||
bytes[i] = value[i];
|
||||
}
|
||||
}
|
||||
Identifier {
|
||||
bytes
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue