Inline str::repeat
This commit is contained in:
parent
116fc31c5c
commit
5a855654de
@ -531,6 +531,7 @@ pub fn into_string(self: Box<str>) -> String {
|
|||||||
#[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