]> git.lizzy.rs Git - rust.git/blobdiff - crates/paths/src/lib.rs
Auto merge of #12808 - Veykril:check-workspace, r=Veykril
[rust.git] / crates / paths / src / lib.rs
index b4beb40e746987b97b148b5dd8768965246538ea..6ae23ac841adaa6a7f97d8841c57aec96f2d2439 100644 (file)
@@ -1,5 +1,8 @@
 //! Thin wrappers around `std::path`, distinguishing between absolute and
 //! relative paths.
+
+#![warn(rust_2018_idioms, unused_lifetimes, semicolon_in_expressions_from_macros)]
+
 use std::{
     borrow::Borrow,
     ffi::OsStr,
@@ -103,6 +106,14 @@ fn as_ref(&self) -> &Path {
     }
 }
 
+impl ToOwned for AbsPath {
+    type Owned = AbsPathBuf;
+
+    fn to_owned(&self) -> Self::Owned {
+        AbsPathBuf(self.0.to_owned())
+    }
+}
+
 impl<'a> TryFrom<&'a Path> for &'a AbsPath {
     type Error = &'a Path;
     fn try_from(path: &'a Path) -> Result<&'a AbsPath, &'a Path> {