Skip to content

Commit 2861274

Browse files
committed
x: clippy fixes
1 parent 119574f commit 2861274

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/tools/x/src/main.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ fn exec_or_status(command: &mut Command) -> io::Result<ExitStatus> {
8989
fn handle_result(result: io::Result<ExitStatus>, cmd: Command) {
9090
match result {
9191
Err(error) => {
92-
eprintln!("Failed to invoke `{:?}`: {}", cmd, error);
92+
eprintln!("Failed to invoke `{cmd:?}`: {error}");
9393
}
9494
Ok(status) => {
9595
process::exit(status.code().unwrap_or(1));
@@ -98,13 +98,10 @@ fn handle_result(result: io::Result<ExitStatus>, cmd: Command) {
9898
}
9999

100100
fn main() {
101-
match env::args().skip(1).next().as_deref() {
102-
Some("--wrapper-version") => {
103-
let version = env!("CARGO_PKG_VERSION");
104-
println!("{}", version);
105-
return;
106-
}
107-
_ => {}
101+
if env::args().nth(1).is_some_and(|s| s == "--wrapper-version") {
102+
let version = env!("CARGO_PKG_VERSION");
103+
println!("{version}");
104+
return;
108105
}
109106
let current = match env::current_dir() {
110107
Ok(dir) => dir,

0 commit comments

Comments
 (0)