MeiliSearch/src/write_to_bytes.rs

10 lines
214 B
Rust
Raw Normal View History

2019-02-17 16:32:43 +01:00
pub trait WriteToBytes {
fn write_to_bytes(&self, bytes: &mut Vec<u8>);
fn into_bytes(&self) -> Vec<u8> {
let mut bytes = Vec::new();
self.write_to_bytes(&mut bytes);
bytes
}
}