Add intra-doc link in str::xxx_char_boundary
This commit is contained in:
parent
df8c20d7a5
commit
df445264b3
@ -211,7 +211,7 @@ pub fn is_char_boundary(&self, index: usize) -> bool {
|
||||
}
|
||||
}
|
||||
|
||||
/// Finds the closest `x` not exceeding `index` where `is_char_boundary(x)` is `true`.
|
||||
/// Finds the closest `x` not exceeding `index` where [`is_char_boundary(x)`] is `true`.
|
||||
///
|
||||
/// This method can help you truncate a string so that it's still valid UTF-8, but doesn't
|
||||
/// exceed a given number of bytes. Note that this is done purely at the character level
|
||||
@ -219,6 +219,8 @@ pub fn is_char_boundary(&self, index: usize) -> bool {
|
||||
/// split. For example, the emoji 🧑🔬 (scientist) could be split so that the string only
|
||||
/// includes 🧑 (person) instead.
|
||||
///
|
||||
/// [`is_char_boundary(x)`]: Self::is_char_boundary
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
@ -247,7 +249,7 @@ pub fn floor_char_boundary(&self, index: usize) -> usize {
|
||||
}
|
||||
}
|
||||
|
||||
/// Finds the closest `x` not below `index` where `is_char_boundary(x)` is `true`.
|
||||
/// Finds the closest `x` not below `index` where [`is_char_boundary(x)`] is `true`.
|
||||
///
|
||||
/// If `index` is greater than the length of the string, this returns the length of the string.
|
||||
///
|
||||
@ -255,7 +257,7 @@ pub fn floor_char_boundary(&self, index: usize) -> usize {
|
||||
/// for more details.
|
||||
///
|
||||
/// [`floor_char_boundary`]: str::floor_char_boundary
|
||||
///
|
||||
/// [`is_char_boundary(x)`]: Self::is_char_boundary
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user