Skip to content

Commit

Permalink
fix: add ?Sized bound to z_serialize
Browse files Browse the repository at this point in the history
  • Loading branch information
wyfo committed Sep 26, 2024
1 parent aec6cf3 commit a3d5177
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions zenoh-ext/src/serialization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub trait Serialize {
serializer.serialize_iter(slice);
}
}
impl<T: Serialize> Serialize for &T {
impl<T: Serialize + ?Sized> Serialize for &T {
fn serialize(&self, serializer: &mut ZSerializer) {
T::serialize(*self, serializer)
}
Expand All @@ -45,7 +45,7 @@ pub trait Deserialize: Sized {
}
}

pub fn z_serialize<T: Serialize>(t: &T) -> ZBytes {
pub fn z_serialize<T: Serialize + ?Sized>(t: &T) -> ZBytes {
let mut zbytes = ZBytes::new();
ZSerializer::new(&mut zbytes).serialize(t);
zbytes
Expand Down

0 comments on commit a3d5177

Please sign in to comment.