Add intra-doc link in str::xxx_prefix

This commit is contained in:
Arthur Carcano 2024-10-30 16:40:55 +01:00
parent 3e33bda032
commit df8c20d7a5

View File

@ -2169,7 +2169,7 @@ pub fn trim_start_matches<P: Pattern>(&self, pat: P) -> &str {
/// Returns a string slice with the prefix removed. /// Returns a string slice with the prefix removed.
/// ///
/// If the string starts with the pattern `prefix`, returns the substring after the prefix, /// If the string starts with the pattern `prefix`, returns the substring after the prefix,
/// wrapped in `Some`. Unlike `trim_start_matches`, this method removes the prefix exactly once. /// wrapped in `Some`. Unlike [`trim_start_matches`], this method removes the prefix exactly once.
/// ///
/// If the string does not start with `prefix`, returns `None`. /// If the string does not start with `prefix`, returns `None`.
/// ///
@ -2178,6 +2178,7 @@ pub fn trim_start_matches<P: Pattern>(&self, pat: P) -> &str {
/// ///
/// [`char`]: prim@char /// [`char`]: prim@char
/// [pattern]: self::pattern /// [pattern]: self::pattern
/// [`trim_start_matches`]: Self::trim_start_matches
/// ///
/// # Examples /// # Examples
/// ///
@ -2196,7 +2197,7 @@ pub fn strip_prefix<P: Pattern>(&self, prefix: P) -> Option<&str> {
/// Returns a string slice with the suffix removed. /// Returns a string slice with the suffix removed.
/// ///
/// If the string ends with the pattern `suffix`, returns the substring before the suffix, /// If the string ends with the pattern `suffix`, returns the substring before the suffix,
/// wrapped in `Some`. Unlike `trim_end_matches`, this method removes the suffix exactly once. /// wrapped in `Some`. Unlike [`trim_end_matches`], this method removes the suffix exactly once.
/// ///
/// If the string does not end with `suffix`, returns `None`. /// If the string does not end with `suffix`, returns `None`.
/// ///
@ -2205,6 +2206,7 @@ pub fn strip_prefix<P: Pattern>(&self, prefix: P) -> Option<&str> {
/// ///
/// [`char`]: prim@char /// [`char`]: prim@char
/// [pattern]: self::pattern /// [pattern]: self::pattern
/// [`trim_end_matches`]: Self::trim_end_matches
/// ///
/// # Examples /// # Examples
/// ///