Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add intra-doc link in str::xxx_prefix
  • Loading branch information
krtab committed Oct 30, 2024
commit df8c20d7a5ddb84eb1e5fd2c366f51d357306f34
6 changes: 4 additions & 2 deletions library/core/src/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2169,7 +2169,7 @@ impl str {
/// Returns a string slice with the prefix removed.
///
/// 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`.
///
Expand All @@ -2178,6 +2178,7 @@ impl str {
///
/// [`char`]: prim@char
/// [pattern]: self::pattern
/// [`trim_start_matches`]: Self::trim_start_matches
///
/// # Examples
///
Expand All @@ -2196,7 +2197,7 @@ impl str {
/// Returns a string slice with the suffix removed.
///
/// 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`.
///
Expand All @@ -2205,6 +2206,7 @@ impl str {
///
/// [`char`]: prim@char
/// [pattern]: self::pattern
/// [`trim_end_matches`]: Self::trim_end_matches
///
/// # Examples
///
Expand Down