Skip to content
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

Merged
merged 4 commits into from
Jun 28, 2017

Conversation

miedzinski
Copy link
Contributor

Fixes #229.

@@ -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> {
Copy link
Owner

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?

@@ -1,6 +1,7 @@
use std::mem;
use std::io::{BufRead, Read};
use std::io::Write;
use std::io::Result as IOResult;
Copy link
Owner

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.

}

fn flush(&mut self) -> IOResult<()> {
self.flush().map_err(Into::into)
Copy link
Owner

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.

@miedzinski
Copy link
Contributor Author

@stepancheg done!

@stepancheg stepancheg merged commit 28b3213 into stepancheg:master Jun 28, 2017
@stepancheg
Copy link
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants