DomainUnparse is useless
This commit is contained in:
parent
dcdfdb8dd9
commit
e80d849f9a
|
@ -15,13 +15,6 @@ pub trait DomainParse<D: Embeddable> {
|
|||
) -> io::Result<D>;
|
||||
}
|
||||
|
||||
pub trait DomainUnparse<D: Embeddable> {
|
||||
fn unparse_embedded(
|
||||
&mut self,
|
||||
d: &D,
|
||||
) -> io::Result<IOValue>;
|
||||
}
|
||||
|
||||
pub trait DomainDecode<D: Embeddable> {
|
||||
fn decode_embedded<'de, 'src, S: BinarySource<'de>>(
|
||||
&mut self,
|
||||
|
@ -119,18 +112,6 @@ impl<D: Embeddable, C: DomainDecode<D>> DomainParse<D> for ViaCodec<C> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<D: Embeddable, C: DomainEncode<D>> DomainUnparse<D> for ViaCodec<C> {
|
||||
fn unparse_embedded(
|
||||
&mut self,
|
||||
d: &D,
|
||||
) -> io::Result<IOValue> {
|
||||
let mut bs = Vec::new();
|
||||
let w = &mut packed::PackedWriter::new(&mut bs);
|
||||
self.0.encode_embedded(w, d)?;
|
||||
packed::annotated_iovalue_from_bytes(&bs)
|
||||
}
|
||||
}
|
||||
|
||||
impl<D: Embeddable, C: DomainParse<D>> DomainDecode<D> for ViaCodec<C> {
|
||||
fn decode_embedded<'de, 'src, S: BinarySource<'de>>(
|
||||
&mut self,
|
||||
|
@ -141,14 +122,3 @@ impl<D: Embeddable, C: DomainParse<D>> DomainDecode<D> for ViaCodec<C> {
|
|||
self.0.parse_embedded(&v)
|
||||
}
|
||||
}
|
||||
|
||||
impl<D: Embeddable, C: DomainUnparse<D>> DomainEncode<D> for ViaCodec<C> {
|
||||
fn encode_embedded<W: Writer>(
|
||||
&mut self,
|
||||
w: &mut W,
|
||||
d: &D,
|
||||
) -> io::Result<()> {
|
||||
let v = self.0.unparse_embedded(d)?;
|
||||
w.write(&mut IOValueDomainCodec, &v)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,6 @@ pub use de::from_value;
|
|||
pub use domain::DomainDecode;
|
||||
pub use domain::DomainEncode;
|
||||
pub use domain::DomainParse;
|
||||
pub use domain::DomainUnparse;
|
||||
pub use domain::IOValueDomainCodec;
|
||||
pub use domain::NoEmbeddedDomainCodec;
|
||||
pub use domain::ViaCodec;
|
||||
|
|
Loading…
Reference in New Issue