@@ -212,14 +212,16 @@ impl str {
212
212
}
213
213
}
214
214
215
- /// Finds the closest `x` not exceeding `index` where `is_char_boundary(x)` is `true`.
215
+ /// Finds the closest `x` not exceeding `index` where [ `is_char_boundary(x)`] is `true`.
216
216
///
217
217
/// This method can help you truncate a string so that it's still valid UTF-8, but doesn't
218
218
/// exceed a given number of bytes. Note that this is done purely at the character level
219
219
/// and can still visually split graphemes, even though the underlying characters aren't
220
220
/// split. For example, the emoji 🧑🔬 (scientist) could be split so that the string only
221
221
/// includes 🧑 (person) instead.
222
222
///
223
+ /// [`is_char_boundary(x)`]: Self::is_char_boundary
224
+ ///
223
225
/// # Examples
224
226
///
225
227
/// ```
@@ -248,15 +250,15 @@ impl str {
248
250
}
249
251
}
250
252
251
- /// Finds the closest `x` not below `index` where `is_char_boundary(x)` is `true`.
253
+ /// Finds the closest `x` not below `index` where [ `is_char_boundary(x)`] is `true`.
252
254
///
253
255
/// If `index` is greater than the length of the string, this returns the length of the string.
254
256
///
255
257
/// This method is the natural complement to [`floor_char_boundary`]. See that method
256
258
/// for more details.
257
259
///
258
260
/// [`floor_char_boundary`]: str::floor_char_boundary
259
- ///
261
+ /// [`is_char_boundary(x)`]: Self::is_char_boundary
260
262
///
261
263
/// # Examples
262
264
///
@@ -2192,7 +2194,7 @@ impl str {
2192
2194
/// Returns a string slice with the prefix removed.
2193
2195
///
2194
2196
/// If the string starts with the pattern `prefix`, returns the substring after the prefix,
2195
- /// wrapped in `Some`. Unlike `trim_start_matches`, this method removes the prefix exactly once.
2197
+ /// wrapped in `Some`. Unlike [ `trim_start_matches`] , this method removes the prefix exactly once.
2196
2198
///
2197
2199
/// If the string does not start with `prefix`, returns `None`.
2198
2200
///
@@ -2201,6 +2203,7 @@ impl str {
2201
2203
///
2202
2204
/// [`char`]: prim@char
2203
2205
/// [pattern]: self::pattern
2206
+ /// [`trim_start_matches`]: Self::trim_start_matches
2204
2207
///
2205
2208
/// # Examples
2206
2209
///
@@ -2219,7 +2222,7 @@ impl str {
2219
2222
/// Returns a string slice with the suffix removed.
2220
2223
///
2221
2224
/// If the string ends with the pattern `suffix`, returns the substring before the suffix,
2222
- /// wrapped in `Some`. Unlike `trim_end_matches`, this method removes the suffix exactly once.
2225
+ /// wrapped in `Some`. Unlike [ `trim_end_matches`] , this method removes the suffix exactly once.
2223
2226
///
2224
2227
/// If the string does not end with `suffix`, returns `None`.
2225
2228
///
@@ -2228,6 +2231,7 @@ impl str {
2228
2231
///
2229
2232
/// [`char`]: prim@char
2230
2233
/// [pattern]: self::pattern
2234
+ /// [`trim_end_matches`]: Self::trim_end_matches
2231
2235
///
2232
2236
/// # Examples
2233
2237
///
0 commit comments