Skip to content

Commit

Permalink
Rollup merge of rust-lang#42227 - ollie27:into_to_from, r=aturon
Browse files Browse the repository at this point in the history
Convert Intos to Froms.

This is a resubmission of rust-lang#42129 without `impl<T> From<Vec<T>> for Box<[T]>`.
  • Loading branch information
Mark-Simulacrum committed Jul 4, 2017
2 parents 7a75d2b + 0d885ef commit 32cbbff
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions src/liballoc/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2008,10 +2008,10 @@ impl From<Box<str>> for 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()
#[stable(feature = "box_from_str", since = "1.20.0")]
impl From<String> for Box<str> {
fn from(s: String) -> Box<str> {
s.into_boxed_str()
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/libstd/ffi/c_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/libstd/ffi/os_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/libstd/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}

Expand Down

0 comments on commit 32cbbff

Please sign in to comment.