Skip to content

Commit

Permalink
Inline str::repeat
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Nov 6, 2024
1 parent 116fc31 commit 5a85565
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions library/alloc/src/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,7 @@ impl str {
#[rustc_allow_incoherent_impl]
#[must_use]
#[stable(feature = "repeat_str", since = "1.16.0")]
#[inline]
pub fn repeat(&self, n: usize) -> String {
unsafe { String::from_utf8_unchecked(self.as_bytes().repeat(n)) }
}
Expand Down

0 comments on commit 5a85565

Please sign in to comment.