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:
Dave Rolsky 2020-10-31 11:34:32 -05:00 committed by GitHub
parent 3478d7c360
commit 47279b33e0
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 (carriage return or line feed) will return the same lines as an
/// otherwise identical string without a final line ending.
///
/// # Examples
///