Skip to content

Commit

Permalink
TODO about read function overload
Browse files Browse the repository at this point in the history
  • Loading branch information
stepancheg committed Jun 9, 2018
1 parent c5a0911 commit fef1106
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion protobuf/src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ impl<'a> CodedInputStream<'a> {
self.source.bytes_until_limit()
}

// TODO: overload with `Read::read`
pub fn read(&mut self, buf: &mut [u8]) -> ProtobufResult<()> {
self.source.read_exact(buf)?;
Ok(())
Expand Down Expand Up @@ -637,7 +638,9 @@ impl<'a> CodedInputStream<'a> {
unsafe {
target.set_len(count);
}
self.read(target)?;
// () is here to make sure correct overload is called
// TODO: rename `read` function
let () = self.read(target)?;
Ok(())
}

Expand Down

0 comments on commit fef1106

Please sign in to comment.