Skip to content

Commit a31a398

Browse files
authored
Rollup merge of #141370 - WaffleLapkin:hiiii, r=jhpratt
add doc alias `replace_first` for `str::replacen` `replace_first` is a sensible name for a function, analogous to actually existing `<[_]>::split_first`, for example. (I just saw someone try to search for it) I think it's reasonable to add such an alias for `replacen`, which replaces the first occurrence of passed a 1.
2 parents 79f0a97 + cff790c commit a31a398

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/alloc/src/str.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ impl str {
320320
/// ```
321321
#[cfg(not(no_global_oom_handling))]
322322
#[rustc_allow_incoherent_impl]
323+
#[doc(alias = "replace_first")]
323324
#[must_use = "this returns the replaced string as a new allocation, \
324325
without modifying the original"]
325326
#[stable(feature = "str_replacen", since = "1.16.0")]

0 commit comments

Comments
 (0)