Skip to content

Commit

Permalink
Auto merge of rust-lang#114428 - ChaiTRex:master, r=dtolnay
Browse files Browse the repository at this point in the history
Convert `Into<ExitStatus> for ExitStatusError` to `From<ExitStatusError> for ExitStatus` in `std::process`

Implementing suggestion from rust-lang#84908 (comment):

> I believe the impl on ExitStatusError should be
>
> ```rust
> impl From<ExitStatusError> for ExitStatus
> ```
>
> rather than
>
> ```rust
> impl Into<ExitStatus> for ExitStatusError
> ```
>
> (there is generally never anything implemented as `Into` first, because implementing `From` reflexively provides `Into`)
  • Loading branch information
bors committed Sep 28, 2023
2 parents e2d6aa7 + 6acb415 commit c01d8d2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions library/std/src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1807,9 +1807,9 @@ impl ExitStatusError {
}

#[unstable(feature = "exit_status_error", issue = "84908")]
impl Into<ExitStatus> for ExitStatusError {
fn into(self) -> ExitStatus {
ExitStatus(self.0.into())
impl From<ExitStatusError> for ExitStatus {
fn from(error: ExitStatusError) -> Self {
Self(error.0.into())
}
}

Expand Down

0 comments on commit c01d8d2

Please sign in to comment.