From 73806417262da26f46d4502fc595d852f10f8f70 Mon Sep 17 00:00:00 2001 From: Connor Lennox Date: Wed, 17 Aug 2022 16:37:56 -0400 Subject: [PATCH 1/2] add compile time to status message --- crates/fj-host/src/lib.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/fj-host/src/lib.rs b/crates/fj-host/src/lib.rs index 956ad0048..3c0f1e1f1 100644 --- a/crates/fj-host/src/lib.rs +++ b/crates/fj-host/src/lib.rs @@ -25,6 +25,7 @@ use std::{ ops::{Deref, DerefMut}, path::{Path, PathBuf}, process::Command, + str, sync::mpsc, thread, }; @@ -92,12 +93,14 @@ impl Model { let command = command_root .arg("build") - .arg("-q") .args(["--manifest-path", &manifest_path]); - let exit_status = command.status()?; + + let cargo_output = command.output()?; + let exit_status = cargo_output.status; if exit_status.success() { - status.update_status("Model compiled successfully!"); + let seconds_taken = str::from_utf8(&cargo_output.stderr).unwrap().rsplit_once(' ').unwrap().1.trim(); + status.update_status(format!("Model compiled successfully in {seconds_taken}!").as_str()); } else { let output = match command.output() { Ok(output) => { From cf0931f600eab48ba4905fdd1a568109d8a0f88f Mon Sep 17 00:00:00 2001 From: Connor Lennox Date: Wed, 17 Aug 2022 16:46:28 -0400 Subject: [PATCH 2/2] run cargo fmt --- crates/fj-host/src/lib.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/crates/fj-host/src/lib.rs b/crates/fj-host/src/lib.rs index 3c0f1e1f1..c4eda5f6b 100644 --- a/crates/fj-host/src/lib.rs +++ b/crates/fj-host/src/lib.rs @@ -99,8 +99,16 @@ impl Model { let exit_status = cargo_output.status; if exit_status.success() { - let seconds_taken = str::from_utf8(&cargo_output.stderr).unwrap().rsplit_once(' ').unwrap().1.trim(); - status.update_status(format!("Model compiled successfully in {seconds_taken}!").as_str()); + let seconds_taken = str::from_utf8(&cargo_output.stderr) + .unwrap() + .rsplit_once(' ') + .unwrap() + .1 + .trim(); + status.update_status( + format!("Model compiled successfully in {seconds_taken}!") + .as_str(), + ); } else { let output = match command.output() { Ok(output) => {