Split out joiner.

This commit is contained in:
Gav
2018-01-16 17:57:42 +01:00
parent caff772b83
commit e410a3a665
6 changed files with 18 additions and 15 deletions
@@ -20,17 +20,6 @@ impl<'a> StreamReader<'a> {
Slicable::from_slice(slice)
}
}
pub trait Joiner {
fn join<T: Slicable + Sized>(self, value: &T) -> Self;
}
impl Joiner for Vec<u8> {
fn join<T: Slicable + Sized>(mut self, value: &T) -> Vec<u8> {
value.as_slice_then(|s| self.extend_from_slice(s));
self
}
}
/*
// Not in use yet
// TODO: introduce fn size_will_be(&self) -> usize; to Slicable trait and implement