Skip to content

Commit c071970

Browse files
committed
remove redundant box wrapper
1 parent 6dc948e commit c071970

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/bootstrap/format.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::path::{Path, PathBuf};
88
use std::process::{Command, Stdio};
99
use std::sync::mpsc::SyncSender;
1010

11-
fn rustfmt(src: &Path, rustfmt: &Path, paths: &[PathBuf], check: bool) -> Box<impl FnMut()> {
11+
fn rustfmt(src: &Path, rustfmt: &Path, paths: &[PathBuf], check: bool) -> impl FnMut() {
1212
let mut cmd = Command::new(&rustfmt);
1313
// avoid the submodule config paths from coming into play,
1414
// we only allow a single global config for the workspace for now
@@ -22,8 +22,8 @@ fn rustfmt(src: &Path, rustfmt: &Path, paths: &[PathBuf], check: bool) -> Box<im
2222
cmd.args(paths);
2323
let cmd_debug = format!("{:?}", cmd);
2424
let mut cmd = cmd.spawn().expect("running rustfmt");
25-
// poor man's async: return a box that'll wait for rustfmt's completion
26-
Box::new(move || {
25+
// poor man's async: return a closure that'll wait for rustfmt's completion
26+
move || {
2727
let status = cmd.wait().unwrap();
2828
if !status.success() {
2929
eprintln!(
@@ -34,7 +34,7 @@ fn rustfmt(src: &Path, rustfmt: &Path, paths: &[PathBuf], check: bool) -> Box<im
3434
);
3535
std::process::exit(1);
3636
}
37-
})
37+
}
3838
}
3939

4040
#[derive(serde::Deserialize)]

0 commit comments

Comments
 (0)