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

std: Account for CRLF in {str, BufRead}::lines #28034

Merged
merged 1 commit into from
Sep 4, 2015

Commits on Sep 4, 2015

  1. std: Account for CRLF in {str, BufRead}::lines

    This commit is an implementation of [RFC 1212][rfc] which tweaks the behavior of
    the `str::lines` and `BufRead::lines` iterators. Both iterators now account for
    `\r\n` sequences in addition to `\n`, allowing for less surprising behavior
    across platforms (especially in the `BufRead` case). Splitting *only* on the
    `\n` character can still be achieved with `split('\n')` in both cases.
    
    The `str::lines_any` function is also now deprecated as `str::lines` is a
    drop-in replacement for it.
    
    [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1212-line-endings.md
    
    Closes rust-lang#28032
    alexcrichton committed Sep 4, 2015
    Configuration menu
    Copy the full SHA
    48615a6 View commit details
    Browse the repository at this point in the history