Skip to content

Commit 27be433

Browse files
committed
Impl AsRef<Path> for Cow<OsStr>
1 parent 9fb4fca commit 27be433

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/libstd/path.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2002,6 +2002,13 @@ impl AsRef<Path> for OsStr {
20022002
}
20032003
}
20042004

2005+
#[stable(feature = "cow_os_str_as_ref_path", since = "1.8.0")]
2006+
impl<'a> AsRef<Path> for Cow<'a, OsStr> {
2007+
fn as_ref(&self) -> &Path {
2008+
Path::new(self)
2009+
}
2010+
}
2011+
20052012
#[stable(feature = "rust1", since = "1.0.0")]
20062013
impl AsRef<Path> for OsString {
20072014
fn as_ref(&self) -> &Path {

0 commit comments

Comments
 (0)