mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-15 05:26:47 +00:00
Implement AsRef<OsStr> for Cow<'_, Path>
In #31751, `impl AsRef<Path> for Cow<'_, OsStr>` was added, but the converse was omitted and it wasn't mentioned in discussion. This seems to have been a simple oversight, as it otherwise implemented traits mutually between `OsStr` and `Path`.
This commit is contained in:
parent
c2110769cd
commit
781b92c3f1
@ -3173,6 +3173,14 @@ impl AsRef<OsStr> for Path {
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "cow_path_as_ref_os_str", since = "CURRENT_RUSTC_VERSION")]
|
||||
impl AsRef<OsStr> for Cow<'_, Path> {
|
||||
#[inline]
|
||||
fn as_ref(&self) -> &OsStr {
|
||||
self.as_os_str()
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
impl fmt::Debug for Path {
|
||||
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
|
@ -941,7 +941,7 @@ impl<'test> TestCx<'test> {
|
||||
.arg("-L")
|
||||
.arg(aux_dir)
|
||||
.arg("-o")
|
||||
.arg(out_dir.as_ref())
|
||||
.arg(out_dir)
|
||||
.arg("--deny")
|
||||
.arg("warnings")
|
||||
.arg(&self.testpaths.file)
|
||||
|
Loading…
Reference in New Issue
Block a user