Skip to content

add io::cursor #167

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

Merged
merged 4 commits into from
Sep 18, 2019
Merged

add io::cursor #167

merged 4 commits into from
Sep 18, 2019

Conversation

yoshuawuyts
Copy link
Contributor

Adds io::Cursor and makes it so io::prelude::* behaves the way it does in std (so it can actually be implemented - though this might just have been a bug on my side??).

Ref #131. Thanks!

@ghost
Copy link

ghost commented Sep 9, 2019

Why is the AsyncBufRead impl commented out? Is there something we're still missing that would make it compile?

@yoshuawuyts
Copy link
Contributor Author

@stjepang yeah, not sure -- I can't get the borrow checker to allow it. If you want to take a look that'd definitely be helpful.

2019-09-10-134945_1920x1080

@taiki-e
Copy link
Contributor

taiki-e commented Sep 10, 2019

@yoshuawuyts it needs to use Pin::get_mut

Poll::Ready(io::BufRead::fill_buf(&mut self.get_mut().inner))

https://github.com/rust-lang-nursery/futures-rs/blob/master/futures-io/src/lib.rs#L599

@yoshuawuyts
Copy link
Contributor Author

@taiki-e that did the trick! -- thanks so much!

@yoshuawuyts yoshuawuyts requested a review from a user September 10, 2019 16:12

Unverified

This user has not yet uploaded their public signing key.
Signed-off-by: Yoshua Wuyts <[email protected]>

Unverified

This user has not yet uploaded their public signing key.
Signed-off-by: Yoshua Wuyts <[email protected]>
fix tests

Unverified

This user has not yet uploaded their public signing key.
Signed-off-by: Yoshua Wuyts <[email protected]>

Unverified

This user has not yet uploaded their public signing key.
Signed-off-by: Yoshua Wuyts <[email protected]>
@yoshuawuyts yoshuawuyts added the enhancement New feature or request label Sep 18, 2019
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks! :)

@ghost
Copy link

ghost commented Sep 18, 2019

bors r+

bors bot added a commit that referenced this pull request Sep 18, 2019
Merge #167

Partially verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
167: add io::cursor r=stjepang a=yoshuawuyts

Adds `io::Cursor` and makes it so `io::prelude::*` behaves the way it does in std (so it can actually be implemented - though this might just have been a bug on my side??).

Ref #131. Thanks!

Co-authored-by: Yoshua Wuyts <[email protected]>
@bors
Copy link
Contributor

bors bot commented Sep 18, 2019

Build succeeded

  • continuous-integration/travis-ci/push

@bors bors bot merged commit 3b8e604 into master Sep 18, 2019
@yoshuawuyts yoshuawuyts deleted the io-cursor branch September 27, 2019 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants