tor-bytes: impl Writeable for &impl Writeable

This commit is contained in:
Ian Jackson 2023-01-24 15:05:24 +00:00
parent a4a4b19f21
commit 043581fe0e
2 changed files with 7 additions and 0 deletions

View File

@ -1 +1,2 @@
ADDED: EncodeError::always_bug method to turn an EcodeError into a Bug
ADDED: impl Writeable for &impl Writeable

View File

@ -109,6 +109,12 @@ impl<W: Writeable + Sized> WriteableOnce for W {
}
}
impl<W: Writeable + ?Sized> Writeable for &W {
fn write_onto<B: Writer + ?Sized>(&self, b: &mut B) -> EncodeResult<()> {
(*self).write_onto(b)
}
}
// ----------------------------------------------------------------------
/// Trait for an object that can be extracted from a Reader.