Now that we've got some more uds wrangling under our belts, I noticed my WireFormat impl of the Vec<u8> should probably not read until the end, it's test code at best and should not be exposed, or at least the implementation should be more robust
impl WireFormat for Vec<u8> {
fn option_from_reader<T: std::io::Read>(reader: &mut T) -> Result<Option<Self>, Error> {
let mut data = Vec::new();
// This should not read to end
reader.read_to_end(&mut data)?;
Ok(Some(data))
}
fn required_size(&self) -> usize {
self.len()
}
fn to_writer<T: std::io::Write>(&self, writer: &mut T) -> Result<usize, Error> {
writer.write_all(self)?;
Ok(self.len())
}
}
impl SingleValueWireFormat for Vec<u8> {}
impl IterableWireFormat for Vec<u8> {}
Now that we've got some more uds wrangling under our belts, I noticed my
WireFormatimpl of theVec<u8>should probably not read until the end, it's test code at best and should not be exposed, or at least the implementation should be more robust