We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1bd17f1 commit 80eaa28Copy full SHA for 80eaa28
src/path/pathbuf.rs
@@ -26,6 +26,15 @@ impl PathBuf {
26
pub fn as_path(&self) -> &Path {
27
self.inner.as_path().into()
28
}
29
+
30
+ /// Converts this `PathBuf` into a [boxed][`Box`] [`Path`].
31
+ ///
32
+ /// [`Box`]: https://doc.rust-lang.org/std/boxed/struct.Box.html
33
+ /// [`Path`]: struct.Path.html
34
+ pub fn into_boxed_path(self) -> Box<Path> {
35
+ let rw = Box::into_raw(self.inner.into_boxed_path()) as *mut Path;
36
+ unsafe { Box::from_raw(rw) }
37
+ }
38
39
40
impl From<std::path::PathBuf> for PathBuf {
0 commit comments