]> git.proxmox.com Git - rustc.git/blobdiff - library/core/src/str/mod.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / library / core / src / str / mod.rs
index ede9a28dcbe7c2f10ffc75eb7814ca96277fb75c..c4f2e283eb3bc6081b7c1bd4f0c71e0a64942c89 100644 (file)
@@ -1158,7 +1158,7 @@ impl str {
         pat.into_searcher(self).next_match().map(|(i, _)| i)
     }
 
-    /// Returns the byte index for the first character of the rightmost match of the pattern in
+    /// Returns the byte index for the first character of the last match of the pattern in
     /// this string slice.
     ///
     /// Returns [`None`] if the pattern doesn't match.
@@ -1632,6 +1632,7 @@ impl str {
     ///
     /// ```
     /// assert_eq!("cfg".split_once('='), None);
+    /// assert_eq!("cfg=".split_once('='), Some(("cfg", "")));
     /// assert_eq!("cfg=foo".split_once('='), Some(("cfg", "foo")));
     /// assert_eq!("cfg=foo=bar".split_once('='), Some(("cfg", "foo=bar")));
     /// ```