Skip to content

Commit 150fce3

Browse files
authored
Rollup merge of #132398 - krtab:add_doc_link, r=Noratrieb
Add a couple of intra-doc links to str
2 parents 8d5cbc7 + df44526 commit 150fce3

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

library/core/src/str/mod.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,14 +212,16 @@ impl str {
212212
}
213213
}
214214

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`.
216216
///
217217
/// This method can help you truncate a string so that it's still valid UTF-8, but doesn't
218218
/// exceed a given number of bytes. Note that this is done purely at the character level
219219
/// and can still visually split graphemes, even though the underlying characters aren't
220220
/// split. For example, the emoji 🧑‍🔬 (scientist) could be split so that the string only
221221
/// includes 🧑 (person) instead.
222222
///
223+
/// [`is_char_boundary(x)`]: Self::is_char_boundary
224+
///
223225
/// # Examples
224226
///
225227
/// ```
@@ -248,15 +250,15 @@ impl str {
248250
}
249251
}
250252

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`.
252254
///
253255
/// If `index` is greater than the length of the string, this returns the length of the string.
254256
///
255257
/// This method is the natural complement to [`floor_char_boundary`]. See that method
256258
/// for more details.
257259
///
258260
/// [`floor_char_boundary`]: str::floor_char_boundary
259-
///
261+
/// [`is_char_boundary(x)`]: Self::is_char_boundary
260262
///
261263
/// # Examples
262264
///
@@ -2193,7 +2195,7 @@ impl str {
21932195
/// Returns a string slice with the prefix removed.
21942196
///
21952197
/// 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.
21972199
///
21982200
/// If the string does not start with `prefix`, returns `None`.
21992201
///
@@ -2202,6 +2204,7 @@ impl str {
22022204
///
22032205
/// [`char`]: prim@char
22042206
/// [pattern]: self::pattern
2207+
/// [`trim_start_matches`]: Self::trim_start_matches
22052208
///
22062209
/// # Examples
22072210
///
@@ -2220,7 +2223,7 @@ impl str {
22202223
/// Returns a string slice with the suffix removed.
22212224
///
22222225
/// 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.
22242227
///
22252228
/// If the string does not end with `suffix`, returns `None`.
22262229
///
@@ -2229,6 +2232,7 @@ impl str {
22292232
///
22302233
/// [`char`]: prim@char
22312234
/// [pattern]: self::pattern
2235+
/// [`trim_end_matches`]: Self::trim_end_matches
22322236
///
22332237
/// # Examples
22342238
///

0 commit comments

Comments
 (0)