Skip to content

Commit c932d7c

Browse files
authored
Rollup merge of #148609 - AMDmi3:rsplit_once_example, r=chenyukang
Sync str::rsplit_once example with str::split_once This adds `"cfg=".rsplit_once('=')` case to `rsplit_once` example, bringing it in sync with example for `split_once`. For consistency and to make life easier for ones who want to ensure bahaviour of this specific edge case.
2 parents 0dafd50 + b975c57 commit c932d7c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/core/src/str/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1953,6 +1953,7 @@ impl str {
19531953
///
19541954
/// ```
19551955
/// assert_eq!("cfg".rsplit_once('='), None);
1956+
/// assert_eq!("cfg=".rsplit_once('='), Some(("cfg", "")));
19561957
/// assert_eq!("cfg=foo".rsplit_once('='), Some(("cfg", "foo")));
19571958
/// assert_eq!("cfg=foo=bar".rsplit_once('='), Some(("cfg=foo", "bar")));
19581959
/// ```

0 commit comments

Comments
 (0)