-
Notifications
You must be signed in to change notification settings - Fork 382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement std::io traits for Coded*Streams #232
Conversation
protobuf/src/buf_read_iter.rs
Outdated
@@ -242,7 +242,7 @@ impl<'ignore> BufReadIter<'ignore> { | |||
} | |||
} | |||
|
|||
fn _read(&mut self, buf: &mut [u8]) -> ProtobufResult<usize> { | |||
pub(crate) fn _read(&mut self, buf: &mut [u8]) -> ProtobufResult<usize> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pub
is enough, since BufReadIter
is not an exported type.
Could you rename function to read
, without underscore please?
protobuf/src/stream.rs
Outdated
@@ -1,6 +1,7 @@ | |||
use std::mem; | |||
use std::io::{BufRead, Read}; | |||
use std::io::Write; | |||
use std::io::Result as IOResult; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use std::io
and then io::Result
I think would be better.
protobuf/src/stream.rs
Outdated
} | ||
|
||
fn flush(&mut self) -> IOResult<()> { | ||
self.flush().map_err(Into::into) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CodedOutputStream::flush(self)
would be clearer I think to make sure that there is no recursion here.
@stepancheg done! |
Thanks! |
Fixes #229.