Skip to content

Convert Intos to Froms. #42129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/libcollections/string.rs
Original file line number Diff line number Diff line change
@@ -2088,9 +2088,9 @@ 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()
impl From<String> for Box<str> {
fn from(s: String) -> Box<str> {
s.into_boxed_str()
}
}

6 changes: 3 additions & 3 deletions src/libcollections/vec.rs
Original file line number Diff line number Diff line change
@@ -2125,9 +2125,9 @@ impl<T> From<Box<[T]>> for Vec<T> {
}

#[stable(feature = "box_from_vec", since = "1.18.0")]
impl<T> Into<Box<[T]>> for Vec<T> {
fn into(self) -> Box<[T]> {
self.into_boxed_slice()
impl<T> From<Vec<T>> for Box<[T]> {
fn from(v: Vec<T>) -> Box<[T]> {
v.into_boxed_slice()
}
}

6 changes: 3 additions & 3 deletions src/libstd/ffi/c_str.rs
Original file line number Diff line number Diff line change
@@ -427,9 +427,9 @@ impl From<Box<CStr>> for CString {
}

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

6 changes: 3 additions & 3 deletions src/libstd/ffi/os_str.rs
Original file line number Diff line number Diff line change
@@ -537,9 +537,9 @@ impl<'a> 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()
impl From<OsString> for Box<OsStr> {
fn from(s: OsString) -> Box<OsStr> {
s.into_boxed_os_str()
}
}

6 changes: 3 additions & 3 deletions src/libstd/path.rs
Original file line number Diff line number Diff line change
@@ -1349,9 +1349,9 @@ impl<'a> 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()
impl From<PathBuf> for Box<Path> {
fn from(p: PathBuf) -> Box<Path> {
p.into_boxed_path()
}
}