Skip to content

Commit 5a97036

Browse files
Clar Charrollie27
Clar Charr
authored andcommitted
Convert Intos to Froms.
1 parent 4450779 commit 5a97036

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

src/liballoc/string.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2009,9 +2009,9 @@ impl From<Box<str>> for String {
20092009
}
20102010

20112011
#[stable(feature = "box_from_str", since = "1.18.0")]
2012-
impl Into<Box<str>> for String {
2013-
fn into(self) -> Box<str> {
2014-
self.into_boxed_str()
2012+
impl From<String> for Box<str> {
2013+
fn from(s: String) -> Box<str> {
2014+
s.into_boxed_str()
20152015
}
20162016
}
20172017

src/libstd/ffi/c_str.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -586,10 +586,10 @@ impl From<Box<CStr>> for CString {
586586
}
587587

588588
#[stable(feature = "box_from_c_string", since = "1.18.0")]
589-
impl Into<Box<CStr>> for CString {
589+
impl From<CString> for Box<CStr> {
590590
#[inline]
591-
fn into(self) -> Box<CStr> {
592-
self.into_boxed_c_str()
591+
fn from(s: CString) -> Box<CStr> {
592+
s.into_boxed_c_str()
593593
}
594594
}
595595

src/libstd/ffi/os_str.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -543,9 +543,9 @@ impl From<Box<OsStr>> for OsString {
543543
}
544544

545545
#[stable(feature = "box_from_os_string", since = "1.18.0")]
546-
impl Into<Box<OsStr>> for OsString {
547-
fn into(self) -> Box<OsStr> {
548-
self.into_boxed_os_str()
546+
impl From<OsString> for Box<OsStr> {
547+
fn from(s: OsString) -> Box<OsStr> {
548+
s.into_boxed_os_str()
549549
}
550550
}
551551

src/libstd/path.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,9 +1349,9 @@ impl From<Box<Path>> for PathBuf {
13491349
}
13501350

13511351
#[stable(feature = "box_from_path_buf", since = "1.18.0")]
1352-
impl Into<Box<Path>> for PathBuf {
1353-
fn into(self) -> Box<Path> {
1354-
self.into_boxed_path()
1352+
impl From<PathBuf> for Box<Path> {
1353+
fn from(p: PathBuf) -> Box<Path> {
1354+
p.into_boxed_path()
13551355
}
13561356
}
13571357

0 commit comments

Comments
 (0)