diff options
| author | Yuki Okushi <huyuumi.dev@gmail.com> | 2020-11-02 14:14:33 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-02 14:14:33 +0900 |
| commit | 0fdb371d5ae2267a7783997b0a84f580059a6488 (patch) | |
| tree | 9e1f8ab2fc1787d5daae7e903578374458c2b53c | |
| parent | d8ef0d7757742862116c455345120dcbfb7e74e0 (diff) | |
| parent | b2d7b3aa26e1821bfdfd8be8a8b65cd6e674ff04 (diff) | |
| download | rust-0fdb371d5ae2267a7783997b0a84f580059a6488.tar.gz rust-0fdb371d5ae2267a7783997b0a84f580059a6488.zip | |
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.
| -rw-r--r-- | library/core/src/str/mod.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/library/core/src/str/mod.rs b/library/core/src/str/mod.rs index ab0c8739330..23d63a4787e 100644 --- a/library/core/src/str/mod.rs +++ b/library/core/src/str/mod.rs @@ -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 /// |
