mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
Inline str::repeat
This commit is contained in:
parent
116fc31c5c
commit
5a855654de
@ -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)) }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user