diff options
| author | Michael Goulet <michael@errs.io> | 2025-05-20 16:03:04 +0200 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-05-20 16:03:04 +0200 |
| commit | 7b5ea0e7f5bece3ddde9a5891c853322cfc6c0f8 (patch) | |
| tree | 6aac5957d2bbbbdd1ae9aa5b66e037cab2affbfe /library/alloc/src | |
| parent | b10555674f355aca2bfe974e50a0b9ab48eb1d87 (diff) | |
| download | rust-7b5ea0e7f5bece3ddde9a5891c853322cfc6c0f8.tar.gz rust-7b5ea0e7f5bece3ddde9a5891c853322cfc6c0f8.zip | |
use Self alias in self types rather than manually substituting it
Diffstat (limited to 'library/alloc/src')
| -rw-r--r-- | library/alloc/src/str.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/alloc/src/str.rs b/library/alloc/src/str.rs index 24c5d4c92f7..8766fd904b0 100644 --- a/library/alloc/src/str.rs +++ b/library/alloc/src/str.rs @@ -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()) } } |
