refactor: node
All checks were successful
ci/woodpecker/push/proto Pipeline was successful
ci/woodpecker/push/node Pipeline was successful

This commit is contained in:
Strix 2023-11-06 18:27:00 +01:00
parent bd9ce9f01f
commit 812748981a
No known key found for this signature in database
GPG key ID: 49B2E37B8915B774
8 changed files with 10 additions and 104 deletions

View file

@ -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
}