Skip to content

Commit df44526

Browse files
committed
Add intra-doc link in str::xxx_char_boundary
1 parent df8c20d commit df44526

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

library/core/src/str/mod.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,16 @@ impl str {
211211
}
212212
}
213213

214-
/// Finds the closest `x` not exceeding `index` where `is_char_boundary(x)` is `true`.
214+
/// Finds the closest `x` not exceeding `index` where [`is_char_boundary(x)`] is `true`.
215215
///
216216
/// This method can help you truncate a string so that it's still valid UTF-8, but doesn't
217217
/// exceed a given number of bytes. Note that this is done purely at the character level
218218
/// and can still visually split graphemes, even though the underlying characters aren't
219219
/// split. For example, the emoji 🧑‍🔬 (scientist) could be split so that the string only
220220
/// includes 🧑 (person) instead.
221221
///
222+
/// [`is_char_boundary(x)`]: Self::is_char_boundary
223+
///
222224
/// # Examples
223225
///
224226
/// ```
@@ -247,15 +249,15 @@ impl str {
247249
}
248250
}
249251

250-
/// Finds the closest `x` not below `index` where `is_char_boundary(x)` is `true`.
252+
/// Finds the closest `x` not below `index` where [`is_char_boundary(x)`] is `true`.
251253
///
252254
/// If `index` is greater than the length of the string, this returns the length of the string.
253255
///
254256
/// This method is the natural complement to [`floor_char_boundary`]. See that method
255257
/// for more details.
256258
///
257259
/// [`floor_char_boundary`]: str::floor_char_boundary
258-
///
260+
/// [`is_char_boundary(x)`]: Self::is_char_boundary
259261
///
260262
/// # Examples
261263
///

0 commit comments

Comments
 (0)