aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_cargo_watch/src/lib.rs
diff options
context:
space:
mode:
authorEmil Lauridsen <[email protected]>2020-03-17 13:56:53 +0000
committerEmil Lauridsen <[email protected]>2020-03-17 13:56:53 +0000
commit2dd887de4761e2493f4df56233b0e11185d74d63 (patch)
tree4a8011773870657b0573d2ea587745999bb14d98 /crates/ra_cargo_watch/src/lib.rs
parent5af81b8456b5fedcc981145bbead7cc7b6b2fc19 (diff)
Use dyn-ref instead of impl to impact compile times the least
Diffstat (limited to 'crates/ra_cargo_watch/src/lib.rs')
-rw-r--r--crates/ra_cargo_watch/src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_cargo_watch/src/lib.rs b/crates/ra_cargo_watch/src/lib.rs
index 71aa28f0a..bffe5eb00 100644
--- a/crates/ra_cargo_watch/src/lib.rs
+++ b/crates/ra_cargo_watch/src/lib.rs
@@ -249,7 +249,7 @@ enum CheckEvent {
249pub fn run_cargo( 249pub fn run_cargo(
250 args: &[String], 250 args: &[String],
251 current_dir: Option<&Path>, 251 current_dir: Option<&Path>,
252 mut on_message: impl FnMut(cargo_metadata::Message) -> bool, 252 on_message: &mut dyn FnMut(cargo_metadata::Message) -> bool,
253) -> Child { 253) -> Child {
254 let mut command = Command::new("cargo"); 254 let mut command = Command::new("cargo");
255 if let Some(current_dir) = current_dir { 255 if let Some(current_dir) = current_dir {
@@ -325,7 +325,7 @@ impl WatchThread {
325 // which will break out of the loop, and continue the shutdown 325 // which will break out of the loop, and continue the shutdown
326 let _ = message_send.send(CheckEvent::Begin); 326 let _ = message_send.send(CheckEvent::Begin);
327 327
328 let mut child = run_cargo(&args, Some(&workspace_root), |message| { 328 let mut child = run_cargo(&args, Some(&workspace_root), &mut |message| {
329 // Skip certain kinds of messages to only spend time on what's useful 329 // Skip certain kinds of messages to only spend time on what's useful
330 match &message { 330 match &message {
331 Message::CompilerArtifact(artifact) if artifact.fresh => return true, 331 Message::CompilerArtifact(artifact) if artifact.fresh => return true,