From 2dd887de4761e2493f4df56233b0e11185d74d63 Mon Sep 17 00:00:00 2001 From: Emil Lauridsen Date: Tue, 17 Mar 2020 14:56:53 +0100 Subject: Use dyn-ref instead of impl to impact compile times the least --- crates/ra_cargo_watch/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_cargo_watch/src/lib.rs') 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 { pub fn run_cargo( args: &[String], current_dir: Option<&Path>, - mut on_message: impl FnMut(cargo_metadata::Message) -> bool, + on_message: &mut dyn FnMut(cargo_metadata::Message) -> bool, ) -> Child { let mut command = Command::new("cargo"); if let Some(current_dir) = current_dir { @@ -325,7 +325,7 @@ impl WatchThread { // which will break out of the loop, and continue the shutdown let _ = message_send.send(CheckEvent::Begin); - let mut child = run_cargo(&args, Some(&workspace_root), |message| { + let mut child = run_cargo(&args, Some(&workspace_root), &mut |message| { // Skip certain kinds of messages to only spend time on what's useful match &message { Message::CompilerArtifact(artifact) if artifact.fresh => return true, -- cgit v1.2.3