Skip to content

Commit 856818a

Browse files
committed
Auto merge of #42227 - ollie27:into_to_from, r=<try>
Convert Intos to Froms. This is a resubmission of #42129 without `impl<T> From<Vec<T>> for Box<[T]>`.
2 parents ae3d387 + 30bbcef commit 856818a

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

src/libcollections/string.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2088,9 +2088,9 @@ impl From<Box<str>> for String {
20882088
}
20892089

20902090
#[stable(feature = "box_from_str", since = "1.18.0")]
2091-
impl Into<Box<str>> for String {
2092-
fn into(self) -> Box<str> {
2093-
self.into_boxed_str()
2091+
impl From<String> for Box<str> {
2092+
fn from(s: String) -> Box<str> {
2093+
s.into_boxed_str()
20942094
}
20952095
}
20962096

src/libstd/ffi/c_str.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -517,9 +517,9 @@ impl From<Box<CStr>> for CString {
517517
}
518518

519519
#[stable(feature = "box_from_c_string", since = "1.18.0")]
520-
impl Into<Box<CStr>> for CString {
521-
fn into(self) -> Box<CStr> {
522-
self.into_boxed_c_str()
520+
impl From<CString> for Box<CStr> {
521+
fn from(s: CString) -> Box<CStr> {
522+
s.into_boxed_c_str()
523523
}
524524
}
525525

src/libstd/ffi/os_str.rs

+3-3
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

+3-3
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)