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
+3 -1
View File
@@ -842,7 +842,9 @@ pub fn split_ascii_whitespace(&self) -> SplitAsciiWhitespace<'_> {
/// 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
///