macro_rules! impl_writeable {
($st:ident, $len: expr, {$($field:ident),*}) => {
- impl<W: Writer> Writeable<W> for $st {
- fn write(&self, w: &mut W) -> Result<(), DecodeError> {
+ impl Writeable for $st {
+ fn write<W: Writer>(&self, w: &mut W) -> Result<(), ::std::io::Error> {
w.size_hint($len);
$( self.$field.write(w)?; )*
Ok(())
}
macro_rules! impl_writeable_len_match {
($st:ident, {$({$m: pat, $l: expr}),*}, {$($field:ident),*}) => {
- impl<W: Writer> Writeable<W> for $st {
- fn write(&self, w: &mut W) -> Result<(), DecodeError> {
+ impl Writeable for $st {
+ fn write<W: Writer>(&self, w: &mut W) -> Result<(), ::std::io::Error> {
w.size_hint(match *self {
$($m => $l,)*
});