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

BufRead::is_eof #40745

Closed
stepancheg opened this issue Mar 22, 2017 · 0 comments
Closed

BufRead::is_eof #40745

stepancheg opened this issue Mar 22, 2017 · 0 comments

Comments

@stepancheg
Copy link
Contributor

is_eof is convenient function when it has no additional overhead.

For BufRead it can be implemented as

    fn is_eof(&mut self) -> Result<bool> {
        self.fill_buf().map(|b| b.is_empty())
    }
bors added a commit to rust-lang-ci/rust that referenced this issue Jun 18, 2021
Add has_data_left() to BufRead

This is a continuation of rust-lang#40747 and also addresses rust-lang#40745. The problem with the previous PR was that it had "eof" in its method name. This PR uses a more descriptive method name, but I'm open to changing it.
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

No branches or pull requests

1 participant