mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Inline str::repeat
This commit is contained in:
parent
116fc31c5c
commit
5a855654de
@ -531,6 +531,7 @@ impl str {
|
|||||||
#[rustc_allow_incoherent_impl]
|
#[rustc_allow_incoherent_impl]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
#[stable(feature = "repeat_str", since = "1.16.0")]
|
#[stable(feature = "repeat_str", since = "1.16.0")]
|
||||||
|
#[inline]
|
||||||
pub fn repeat(&self, n: usize) -> String {
|
pub fn repeat(&self, n: usize) -> String {
|
||||||
unsafe { String::from_utf8_unchecked(self.as_bytes().repeat(n)) }
|
unsafe { String::from_utf8_unchecked(self.as_bytes().repeat(n)) }
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user