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:
parent
3478d7c360
commit
47279b33e0
1 changed files with 3 additions and 1 deletions
|
|
@ -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
|
||||
///
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue