@@ -3158,11 +3158,11 @@ impl str {
3158
3158
/// Simple patterns:
3159
3159
///
3160
3160
/// ```
3161
- /// let s = "Löwe 老虎 Léopard";
3161
+ /// let s = "Löwe 老虎 Léopard Gepardi ";
3162
3162
///
3163
3163
/// assert_eq!(s.find('L'), Some(0));
3164
3164
/// assert_eq!(s.find('é'), Some(14));
3165
- /// assert_eq!(s.find("Léopard "), Some(13 ));
3165
+ /// assert_eq!(s.find("pard "), Some(17 ));
3166
3166
/// ```
3167
3167
///
3168
3168
/// More complex patterns using point-free style and closures:
@@ -3190,8 +3190,8 @@ impl str {
3190
3190
pat. into_searcher ( self ) . next_match ( ) . map ( |( i, _) | i)
3191
3191
}
3192
3192
3193
- /// Returns the byte index of the last character of this string slice that
3194
- /// matches the pattern .
3193
+ /// Returns the byte index for the first character of the rightmost match of the pattern in
3194
+ /// this string slice .
3195
3195
///
3196
3196
/// Returns [`None`] if the pattern doesn't match.
3197
3197
///
@@ -3207,10 +3207,11 @@ impl str {
3207
3207
/// Simple patterns:
3208
3208
///
3209
3209
/// ```
3210
- /// let s = "Löwe 老虎 Léopard";
3210
+ /// let s = "Löwe 老虎 Léopard Gepardi ";
3211
3211
///
3212
3212
/// assert_eq!(s.rfind('L'), Some(13));
3213
3213
/// assert_eq!(s.rfind('é'), Some(14));
3214
+ /// assert_eq!(s.rfind("pard"), Some(24));
3214
3215
/// ```
3215
3216
///
3216
3217
/// More complex patterns with closures:
0 commit comments