Skip to content

Commit 0fdb371

Browse files
authored
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.
2 parents d8ef0d7 + b2d7b3a commit 0fdb371

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

library/core/src/str/mod.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,9 @@ impl str {
842842
/// Lines are ended with either a newline (`\n`) or a carriage return with
843843
/// a line feed (`\r\n`).
844844
///
845-
/// The final line ending is optional.
845+
/// The final line ending is optional. A string that ends with a final line
846+
/// ending will return the same lines as an otherwise identical string
847+
/// without a final line ending.
846848
///
847849
/// # Examples
848850
///

0 commit comments

Comments
 (0)