Skip to content

Commit 29b5877

Browse files
committed
Hard-code doclink to avoid issue 98941
Also line-wrap doc-comment.
1 parent 33aad26 commit 29b5877

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

library/alloc/src/string.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2005,7 +2005,9 @@ impl String {
20052005

20062006
/// Replaces the leftmost occurrence of a pattern with another string, in-place.
20072007
///
2008-
/// This method should be preferred over [`String::replacen(..., 1)`](str::replacen) as it can use the `String`'s existing capacity to prevent a reallocation if sufficient space is available.
2008+
/// This method should be preferred over [`String::replacen(..., 1)`][replacen]
2009+
/// as it can use the `String`'s existing capacity to prevent a reallocation if
2010+
/// sufficient space is available.
20092011
///
20102012
/// # Examples
20112013
///
@@ -2020,6 +2022,8 @@ impl String {
20202022
/// s.replace_first('❌', "✅");
20212023
/// assert_eq!(s, "Test Results: ✅❌❌");
20222024
/// ```
2025+
///
2026+
/// [replacen]: ../../std/primitive.str.html#method.replacen
20232027
#[cfg(not(no_global_oom_handling))]
20242028
#[unstable(feature = "string_replace_in_place", issue = "none")]
20252029
pub fn replace_first<P: Pattern>(&mut self, from: P, to: &str) {

0 commit comments

Comments
 (0)