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.
to_path_buf()
RelPath
1 parent a41cec9 commit 0005794Copy full SHA for 0005794
crates/paths/src/lib.rs
@@ -305,6 +305,11 @@ impl RelPath {
305
pub fn new_unchecked(path: &Path) -> &RelPath {
306
unsafe { &*(path as *const Path as *const RelPath) }
307
}
308
+
309
+ /// Equivalent of [`Path::to_path_buf`] for `RelPath`.
310
+ pub fn to_path_buf(&self) -> RelPathBuf {
311
+ RelPathBuf::try_from(self.0.to_path_buf()).unwrap()
312
+ }
313
314
315
/// Taken from <https://github.com/rust-lang/cargo/blob/79c769c3d7b4c2cf6a93781575b7f592ef974255/src/cargo/util/paths.rs#L60-L85>
0 commit comments