write_into
Defines a trait built on top of io::Write
to write things into it.
```rust use leb128; use std::{convert, io}; use writeinto::{WriteInto, writeinto};
// https://en.wikipedia.org/wiki/LEB128
struct Leb128
implleb128
crate uses u64
and I'm too lazy to write multiple implementations (._.)
T: convert::Into
fn write_into(self, sink: &mut impl io::Write) -> io::Result<Self::Output> {
leb128::write::unsigned(sink, self.0.into())?;
Ok(())
}
}
let mut buffer = Vec::new(); write_into(&mut buffer, Leb128(1337u32)).unwrap(); ```