Skip to content

Commit

Permalink
feat(zenoh_id): replacing from slice with function
Browse files Browse the repository at this point in the history
  • Loading branch information
DariusIMP committed Sep 9, 2024
1 parent 3c14ad1 commit 5e04759
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions commons/zenoh-config/src/wrappers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ impl ZenohId {
pub fn into_keyexpr(self) -> OwnedKeyExpr {
self.into()
}

pub fn to_le_bytes(self) -> [u8; uhlc::ID::MAX_SIZE] {
self.0.to_le_bytes()
}
}

impl fmt::Debug for ZenohId {
Expand Down Expand Up @@ -81,13 +85,6 @@ impl From<ZenohId> for OwnedKeyExpr {
}
}

impl From<ZenohId> for [u8; ZenohIdProto::MAX_SIZE] {
fn from(value: ZenohId) -> Self {
let proto: ZenohIdProto = value.into();
proto.to_le_bytes()
}
}

impl From<&ZenohId> for OwnedKeyExpr {
fn from(zid: &ZenohId) -> Self {
(*zid).into()
Expand Down

0 comments on commit 5e04759

Please sign in to comment.