about summary refs log tree commit diff
diff options
context:
space:
mode:
authorThe8472 <git@infinite-source.de>2021-02-12 21:27:16 +0100
committerThe8472 <git@infinite-source.de>2021-02-20 23:12:56 +0100
commitc07197046d40f973ce2217328444426214193e7e (patch)
treee2f573f5f41109c3a94bd1a4610dd64225393142
parent6dc948e7238780dbe3d8e19b03f720c7c1e53449 (diff)
downloadrust-c07197046d40f973ce2217328444426214193e7e.tar.gz
rust-c07197046d40f973ce2217328444426214193e7e.zip
remove redundant box wrapper
-rw-r--r--src/bootstrap/format.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bootstrap/format.rs b/src/bootstrap/format.rs
index 3c9b66e5a01..d21e3408144 100644
--- a/src/bootstrap/format.rs
+++ b/src/bootstrap/format.rs
@@ -8,7 +8,7 @@ use std::path::{Path, PathBuf};
 use std::process::{Command, Stdio};
 use std::sync::mpsc::SyncSender;
 
-fn rustfmt(src: &Path, rustfmt: &Path, paths: &[PathBuf], check: bool) -> Box<impl FnMut()> {
+fn rustfmt(src: &Path, rustfmt: &Path, paths: &[PathBuf], check: bool) -> impl FnMut() {
     let mut cmd = Command::new(&rustfmt);
     // avoid the submodule config paths from coming into play,
     // 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
     cmd.args(paths);
     let cmd_debug = format!("{:?}", cmd);
     let mut cmd = cmd.spawn().expect("running rustfmt");
-    // poor man's async: return a box that'll wait for rustfmt's completion
-    Box::new(move || {
+    // poor man's async: return a closure that'll wait for rustfmt's completion
+    move || {
         let status = cmd.wait().unwrap();
         if !status.success() {
             eprintln!(
@@ -34,7 +34,7 @@ fn rustfmt(src: &Path, rustfmt: &Path, paths: &[PathBuf], check: bool) -> Box<im
             );
             std::process::exit(1);
         }
-    })
+    }
 }
 
 #[derive(serde::Deserialize)]