about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorMark Simulacrum <mark.simulacrum@gmail.com>2017-07-04 07:41:33 -0600
committerGitHub <noreply@github.com>2017-07-04 07:41:33 -0600
commit32cbbffea2ebf4bb222b54bd67e1a4e54c1ca3c5 (patch)
treefb259084358c1ca157812e4f338378951bf3f65c /src/libstd
parent7a75d2bec402b76688da35402575aa7d8e61d91c (diff)
parent0d885efe16899c2dbad2918345c9ede7b83caa7f (diff)
downloadrust-32cbbffea2ebf4bb222b54bd67e1a4e54c1ca3c5.tar.gz
rust-32cbbffea2ebf4bb222b54bd67e1a4e54c1ca3c5.zip
Rollup merge of #42227 - ollie27:into_to_from, r=aturon
Convert Intos to Froms.

This is a resubmission of #42129 without `impl<T> From<Vec<T>> for Box<[T]>`.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/ffi/c_str.rs8
-rw-r--r--src/libstd/ffi/os_str.rs8
-rw-r--r--src/libstd/path.rs8
3 files changed, 12 insertions, 12 deletions
diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs
index 1a91417ca0e..5f0b11a616e 100644
--- a/src/libstd/ffi/c_str.rs
+++ b/src/libstd/ffi/c_str.rs
@@ -585,11 +585,11 @@ impl From<Box<CStr>> for CString {
     }
 }
 
-#[stable(feature = "box_from_c_string", since = "1.18.0")]
-impl Into<Box<CStr>> for CString {
+#[stable(feature = "box_from_c_string", since = "1.20.0")]
+impl From<CString> for Box<CStr> {
     #[inline]
-    fn into(self) -> Box<CStr> {
-        self.into_boxed_c_str()
+    fn from(s: CString) -> Box<CStr> {
+        s.into_boxed_c_str()
     }
 }
 
diff --git a/src/libstd/ffi/os_str.rs b/src/libstd/ffi/os_str.rs
index 42d641706a8..02a13ed7a5a 100644
--- a/src/libstd/ffi/os_str.rs
+++ b/src/libstd/ffi/os_str.rs
@@ -540,10 +540,10 @@ impl From<Box<OsStr>> for OsString {
     }
 }
 
-#[stable(feature = "box_from_os_string", since = "1.18.0")]
-impl Into<Box<OsStr>> for OsString {
-    fn into(self) -> Box<OsStr> {
-        self.into_boxed_os_str()
+#[stable(feature = "box_from_os_string", since = "1.20.0")]
+impl From<OsString> for Box<OsStr> {
+    fn from(s: OsString) -> Box<OsStr> {
+        s.into_boxed_os_str()
     }
 }
 
diff --git a/src/libstd/path.rs b/src/libstd/path.rs
index 472ce6bc4fe..e7c7be981d2 100644
--- a/src/libstd/path.rs
+++ b/src/libstd/path.rs
@@ -1348,10 +1348,10 @@ impl From<Box<Path>> for PathBuf {
     }
 }
 
-#[stable(feature = "box_from_path_buf", since = "1.18.0")]
-impl Into<Box<Path>> for PathBuf {
-    fn into(self) -> Box<Path> {
-        self.into_boxed_path()
+#[stable(feature = "box_from_path_buf", since = "1.20.0")]
+impl From<PathBuf> for Box<Path> {
+    fn from(p: PathBuf) -> Box<Path> {
+        p.into_boxed_path()
     }
 }