]> git.lizzy.rs Git - rust.git/commitdiff
Convert Intos to Froms.
authorClar Charr <clar@charr.xyz>
Sat, 20 May 2017 19:40:53 +0000 (15:40 -0400)
committerOliver Middleton <olliemail27@gmail.com>
Wed, 21 Jun 2017 00:18:18 +0000 (01:18 +0100)
src/liballoc/string.rs
src/libstd/ffi/c_str.rs
src/libstd/ffi/os_str.rs
src/libstd/path.rs

index 2cb81029f95e2a1ea89d9fb4aad1ca5111456057..c1ef1c2f96c7311100f9f4e905112570b13a0096 100644 (file)
@@ -2009,9 +2009,9 @@ fn from(s: Box<str>) -> String {
 }
 
 #[stable(feature = "box_from_str", since = "1.18.0")]
-impl Into<Box<str>> for String {
-    fn into(self) -> Box<str> {
-        self.into_boxed_str()
+impl From<String> for Box<str> {
+    fn from(s: String) -> Box<str> {
+        s.into_boxed_str()
     }
 }
 
index 1a91417ca0e92dcdcb623a5e840e668affb9fd4a..1586e0a4ddbd3248cf68ac47f0e9ec1eea4ca644 100644 (file)
@@ -586,10 +586,10 @@ fn from(s: Box<CStr>) -> CString {
 }
 
 #[stable(feature = "box_from_c_string", since = "1.18.0")]
-impl Into<Box<CStr>> for CString {
+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()
     }
 }
 
index f54d79c201f4869ae9fa01b0d499e89f97a85d3b..3815f986681804c017e89f486b4a82ff069c3292 100644 (file)
@@ -543,9 +543,9 @@ fn from(boxed: Box<OsStr>) -> 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()
+impl From<OsString> for Box<OsStr> {
+    fn from(s: OsString) -> Box<OsStr> {
+        s.into_boxed_os_str()
     }
 }
 
index 42a54ed6d754c9dfbcafd38641eff8ffc723252e..e9bf7b33b8e4250b7abb9f29bb4009fa687b175a 100644 (file)
@@ -1349,9 +1349,9 @@ fn from(boxed: Box<Path>) -> 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()
+impl From<PathBuf> for Box<Path> {
+    fn from(p: PathBuf) -> Box<Path> {
+        p.into_boxed_path()
     }
 }