From 86143b52ddd690658b363a470241e4c074bc3002 Mon Sep 17 00:00:00 2001 From: Joseph Perez Date: Sun, 29 Sep 2024 18:06:55 +0200 Subject: [PATCH] fix: remove litigious `From` implementation --- zenoh-ext/src/serialization.rs | 12 ------------ zenoh/src/api/bytes.rs | 9 --------- 2 files changed, 21 deletions(-) diff --git a/zenoh-ext/src/serialization.rs b/zenoh-ext/src/serialization.rs index a368bc168..a6d24faa4 100644 --- a/zenoh-ext/src/serialization.rs +++ b/zenoh-ext/src/serialization.rs @@ -95,12 +95,6 @@ impl From for ZBytes { } } -impl From for ZSerializer { - fn from(value: ZBytesWriter) -> Self { - Self(value) - } -} - #[derive(Debug)] pub struct ZDeserializer<'a>(ZBytesReader<'a>); @@ -129,12 +123,6 @@ impl<'a> ZDeserializer<'a> { } } -impl<'a> From> for ZDeserializer<'a> { - fn from(value: ZBytesReader<'a>) -> Self { - Self(value) - } -} - pub struct ZReadIter<'a, 'b, T: Deserialize> { deserializer: &'b mut ZDeserializer<'a>, len: usize, diff --git a/zenoh/src/api/bytes.rs b/zenoh/src/api/bytes.rs index 4dfe11aeb..49ab1f480 100644 --- a/zenoh/src/api/bytes.rs +++ b/zenoh/src/api/bytes.rs @@ -302,15 +302,6 @@ impl From for ZBytes { } } -impl From for ZBytesWriter { - fn from(value: ZBytes) -> Self { - Self { - zbuf: value.0, - vec: vec![], - } - } -} - impl std::io::Write for ZBytesWriter { fn write(&mut self, buf: &[u8]) -> std::io::Result { std::io::Write::write(&mut self.vec, buf)