Rollup merge of #78606 - autarch:patch-1, r=m-ou-se

Clarify handling of final line ending in str::lines()

I found the description as it stands a bit confusing. I've added a bit more explanation to make it clear that a trailing line ending does not produce a final empty line.
This commit is contained in:
Yuki Okushi 2020-11-02 14:14:33 +09:00 committed by GitHub
commit 0fdb371d5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -842,7 +842,9 @@ impl str {
/// Lines are ended with either a newline (`\n`) or a carriage return with
/// a line feed (`\r\n`).
///
/// The final line ending is optional.
/// The final line ending is optional. A string that ends with a final line
/// ending will return the same lines as an otherwise identical string
/// without a final line ending.
///
/// # Examples
///