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]>`.
This commit is contained in:
Mark Simulacrum 2017-07-04 07:41:33 -06:00 committed by GitHub
commit 32cbbffea2
4 changed files with 16 additions and 16 deletions

View File

@ -2008,10 +2008,10 @@ impl From<Box<str>> for String {
} }
} }
#[stable(feature = "box_from_str", since = "1.18.0")] #[stable(feature = "box_from_str", since = "1.20.0")]
impl Into<Box<str>> for String { impl From<String> for Box<str> {
fn into(self) -> Box<str> { fn from(s: String) -> Box<str> {
self.into_boxed_str() s.into_boxed_str()
} }
} }

View File

@ -585,11 +585,11 @@ impl From<Box<CStr>> for CString {
} }
} }
#[stable(feature = "box_from_c_string", since = "1.18.0")] #[stable(feature = "box_from_c_string", since = "1.20.0")]
impl Into<Box<CStr>> for CString { impl From<CString> for Box<CStr> {
#[inline] #[inline]
fn into(self) -> Box<CStr> { fn from(s: CString) -> Box<CStr> {
self.into_boxed_c_str() s.into_boxed_c_str()
} }
} }

View File

@ -540,10 +540,10 @@ impl From<Box<OsStr>> for OsString {
} }
} }
#[stable(feature = "box_from_os_string", since = "1.18.0")] #[stable(feature = "box_from_os_string", since = "1.20.0")]
impl Into<Box<OsStr>> for OsString { impl From<OsString> for Box<OsStr> {
fn into(self) -> Box<OsStr> { fn from(s: OsString) -> Box<OsStr> {
self.into_boxed_os_str() s.into_boxed_os_str()
} }
} }

View File

@ -1348,10 +1348,10 @@ impl From<Box<Path>> for PathBuf {
} }
} }
#[stable(feature = "box_from_path_buf", since = "1.18.0")] #[stable(feature = "box_from_path_buf", since = "1.20.0")]
impl Into<Box<Path>> for PathBuf { impl From<PathBuf> for Box<Path> {
fn into(self) -> Box<Path> { fn from(p: PathBuf) -> Box<Path> {
self.into_boxed_path() p.into_boxed_path()
} }
} }