use Self alias in self types rather than manually substituting it
This commit is contained in:
@@ -234,7 +234,7 @@ impl str {
|
||||
#[stable(feature = "str_box_extras", since = "1.20.0")]
|
||||
#[must_use = "`self` will be dropped if the result is not used"]
|
||||
#[inline]
|
||||
pub fn into_boxed_bytes(self: Box<str>) -> Box<[u8]> {
|
||||
pub fn into_boxed_bytes(self: Box<Self>) -> Box<[u8]> {
|
||||
self.into()
|
||||
}
|
||||
|
||||
@@ -501,7 +501,7 @@ impl str {
|
||||
#[rustc_allow_incoherent_impl]
|
||||
#[must_use = "`self` will be dropped if the result is not used"]
|
||||
#[inline]
|
||||
pub fn into_string(self: Box<str>) -> String {
|
||||
pub fn into_string(self: Box<Self>) -> String {
|
||||
let slice = Box::<[u8]>::from(self);
|
||||
unsafe { String::from_utf8_unchecked(slice.into_vec()) }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user