@@ -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
///
@@ -2193,7 +2195,7 @@ impl str {
2193
2195
/// Returns a string slice with the prefix removed.
2194
2196
///
2195
2197
/// If the string starts with the pattern `prefix`, returns the substring after the prefix,
2196
- /// wrapped in `Some`. Unlike `trim_start_matches`, this method removes the prefix exactly once.
2198
+ /// wrapped in `Some`. Unlike [ `trim_start_matches`] , this method removes the prefix exactly once.
2197
2199
///
2198
2200
/// If the string does not start with `prefix`, returns `None`.
2199
2201
///
@@ -2202,6 +2204,7 @@ impl str {
2202
2204
///
2203
2205
/// [`char`]: prim@char
2204
2206
/// [pattern]: self::pattern
2207
+ /// [`trim_start_matches`]: Self::trim_start_matches
2205
2208
///
2206
2209
/// # Examples
2207
2210
///
@@ -2220,7 +2223,7 @@ impl str {
2220
2223
/// Returns a string slice with the suffix removed.
2221
2224
///
2222
2225
/// If the string ends with the pattern `suffix`, returns the substring before the suffix,
2223
- /// wrapped in `Some`. Unlike `trim_end_matches`, this method removes the suffix exactly once.
2226
+ /// wrapped in `Some`. Unlike [ `trim_end_matches`] , this method removes the suffix exactly once.
2224
2227
///
2225
2228
/// If the string does not end with `suffix`, returns `None`.
2226
2229
///
@@ -2229,6 +2232,7 @@ impl str {
2229
2232
///
2230
2233
/// [`char`]: prim@char
2231
2234
/// [pattern]: self::pattern
2235
+ /// [`trim_end_matches`]: Self::trim_end_matches
2232
2236
///
2233
2237
/// # Examples
2234
2238
///
0 commit comments