Skip to content

Commit 32cbbff

Browse files
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]>`.
2 parents 7a75d2b + 0d885ef commit 32cbbff

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

src/liballoc/string.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2008,10 +2008,10 @@ impl From<Box<str>> for String {
20082008
}
20092009
}
20102010

2011-
#[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()
2011+
#[stable(feature = "box_from_str", since = "1.20.0")]
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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -585,11 +585,11 @@ impl From<Box<CStr>> for CString {
585585
}
586586
}
587587

588-
#[stable(feature = "box_from_c_string", since = "1.18.0")]
589-
impl Into<Box<CStr>> for CString {
588+
#[stable(feature = "box_from_c_string", since = "1.20.0")]
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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -540,10 +540,10 @@ impl From<Box<OsStr>> for OsString {
540540
}
541541
}
542542

543-
#[stable(feature = "box_from_os_string", since = "1.18.0")]
544-
impl Into<Box<OsStr>> for OsString {
545-
fn into(self) -> Box<OsStr> {
546-
self.into_boxed_os_str()
543+
#[stable(feature = "box_from_os_string", since = "1.20.0")]
544+
impl From<OsString> for Box<OsStr> {
545+
fn from(s: OsString) -> Box<OsStr> {
546+
s.into_boxed_os_str()
547547
}
548548
}
549549

src/libstd/path.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,10 +1348,10 @@ impl From<Box<Path>> for PathBuf {
13481348
}
13491349
}
13501350

1351-
#[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()
1351+
#[stable(feature = "box_from_path_buf", since = "1.20.0")]
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)