use Self alias in self types rather than manually substituting it

This commit is contained in:
Michael Goulet
2025-05-20 16:03:04 +02:00
parent b10555674f
commit 7b5ea0e7f5
4 changed files with 5 additions and 5 deletions

View File

@@ -3163,7 +3163,7 @@ impl Path {
/// allocating.
#[stable(feature = "into_boxed_path", since = "1.20.0")]
#[must_use = "`self` will be dropped if the result is not used"]
pub fn into_path_buf(self: Box<Path>) -> PathBuf {
pub fn into_path_buf(self: Box<Self>) -> PathBuf {
let rw = Box::into_raw(self) as *mut OsStr;
let inner = unsafe { Box::from_raw(rw) };
PathBuf { inner: OsString::from(inner) }