Skip to content

Commit c20d164

Browse files
authored
Merge pull request #2389 from fermyon/remove-dead-code
Remove dead code newly discovered by Rust 1.77.0
2 parents f7cb8ae + 5ed81bc commit c20d164

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

crates/plugins/src/git.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use anyhow::Result;
2+
use std::io::ErrorKind;
23
use std::path::{Path, PathBuf};
3-
use std::{io::ErrorKind, process::ExitStatus};
44
use tokio::process::Command;
55
use url::Url;
66

@@ -64,7 +64,7 @@ impl GitSource {
6464
// TODO: the following and templates/git.rs are duplicates
6565

6666
pub(crate) enum GitError {
67-
ProgramFailed(ExitStatus, Vec<u8>),
67+
ProgramFailed(Vec<u8>),
6868
ProgramNotFound,
6969
Other(anyhow::Error),
7070
}
@@ -74,7 +74,7 @@ impl std::fmt::Display for GitError {
7474
match self {
7575
Self::ProgramNotFound => f.write_str("`git` command not found - is git installed?"),
7676
Self::Other(e) => e.fmt(f),
77-
Self::ProgramFailed(_, stderr) => match std::str::from_utf8(stderr) {
77+
Self::ProgramFailed(stderr) => match std::str::from_utf8(stderr) {
7878
Ok(s) => f.write_str(s),
7979
Err(_) => f.write_str("(cannot get error)"),
8080
},
@@ -93,7 +93,7 @@ impl UnderstandGitResult for Result<std::process::Output, std::io::Error> {
9393
if output.status.success() {
9494
Ok(output.stdout)
9595
} else {
96-
Err(GitError::ProgramFailed(output.status, output.stderr))
96+
Err(GitError::ProgramFailed(output.stderr))
9797
}
9898
}
9999
Err(e) => match e.kind() {

crates/templates/src/git.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
use std::{io::ErrorKind, process::ExitStatus};
1+
use std::io::ErrorKind;
22

33
// TODO: the following and the second half of plugins/git.rs are duplicates
44

55
pub(crate) enum GitError {
6-
ProgramFailed(ExitStatus, Vec<u8>),
6+
ProgramFailed(Vec<u8>),
77
ProgramNotFound,
88
Other(anyhow::Error),
99
}
@@ -13,7 +13,7 @@ impl std::fmt::Display for GitError {
1313
match self {
1414
Self::ProgramNotFound => f.write_str("`git` command not found - is git installed?"),
1515
Self::Other(e) => e.fmt(f),
16-
Self::ProgramFailed(_, stderr) => match std::str::from_utf8(stderr) {
16+
Self::ProgramFailed(stderr) => match std::str::from_utf8(stderr) {
1717
Ok(s) => f.write_str(s),
1818
Err(_) => f.write_str("(cannot get error)"),
1919
},
@@ -32,7 +32,7 @@ impl UnderstandGitResult for Result<std::process::Output, std::io::Error> {
3232
if output.status.success() {
3333
Ok(output.stdout)
3434
} else {
35-
Err(GitError::ProgramFailed(output.status, output.stderr))
35+
Err(GitError::ProgramFailed(output.stderr))
3636
}
3737
}
3838
Err(e) => match e.kind() {

0 commit comments

Comments
 (0)