diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2016-11-04 16:49:32 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2016-11-05 10:50:25 -0700 |
| commit | 727f1d3f1647553deab09f22746b7e482358e5f6 (patch) | |
| tree | a49911324265afb5bdb6757e9f6fc171e8648414 /src/libstd | |
| parent | 0670d4b7f33d2b66a6de069901ab47768180e402 (diff) | |
| parent | 3e4bd8843829284a62af22687ee415a66c8207cc (diff) | |
| download | rust-727f1d3f1647553deab09f22746b7e482358e5f6.tar.gz rust-727f1d3f1647553deab09f22746b7e482358e5f6.zip | |
Rollup merge of #37585 - leodasvacas:change_into_to_from, r=alexcrichton
Change `Into<Vec<u8>> for String` and `Into<OsString> for PathBuf` to From Fixes #37561. First contribution, happy with any and all feedback!
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/path.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libstd/path.rs b/src/libstd/path.rs index 9b7f9980cc0..bb6883236e8 100644 --- a/src/libstd/path.rs +++ b/src/libstd/path.rs @@ -1173,6 +1173,13 @@ impl From<OsString> for PathBuf { } } +#[stable(feature = "from_path_buf_for_os_string", since = "1.14.0")] +impl From<PathBuf> for OsString { + fn from(path_buf : PathBuf) -> OsString { + path_buf.inner + } +} + #[stable(feature = "rust1", since = "1.0.0")] impl From<String> for PathBuf { fn from(s: String) -> PathBuf { @@ -1283,13 +1290,6 @@ impl AsRef<OsStr> for PathBuf { } } -#[stable(feature = "rust1", since = "1.0.0")] -impl Into<OsString> for PathBuf { - fn into(self) -> OsString { - self.inner - } -} - /// A slice of a path (akin to [`str`]). /// /// This type supports a number of operations for inspecting a path, including |
