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

core: io: the read_until function checks bytes not chars, so type should reflect that. #5933

Merged
merged 1 commit into from
Apr 18, 2013

Conversation

huonw
Copy link
Member

@huonw huonw commented Apr 18, 2013

read_until is just doing a bytewise comparison. This means the following program prints xyå12, not xy, which it should if it was actually checking chars.

fn main() {
    do io::with_str_reader("xyå12") |r| {
        io::println(r.read_until('å', false));
    }
}

This patch makes the type of read_until match what it is actually doing.

bors added a commit that referenced this pull request Apr 18, 2013
`read_until` is just doing a bytewise comparison. This means the following program prints `xyå12`, not `xy`, which it should if it was actually checking chars.

```rust
fn main() {
    do io::with_str_reader("xyå12") |r| {
        io::println(r.read_until('å', false));
    }
}
```

This patch makes the type of read_until match what it is actually doing.
@bors bors closed this Apr 18, 2013
@bors bors merged commit 19cc352 into rust-lang:incoming Apr 18, 2013
@huonw huonw deleted the core-read-until-byte branch April 19, 2013 07:26
flip1995 pushed a commit to flip1995/rust that referenced this pull request Aug 28, 2020
Fix false negative in `option_as_ref_deref`

Closes rust-lang#5927

changelog: Fix false negative in `option_as_ref_deref`
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.

3 participants