From f1025071edfb787309a75d4bb68bec0c2bd906bb Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sat, 24 Jun 2023 15:05:59 +0200 Subject: Tidy up --- cli/src/main.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'cli/src/main.rs') diff --git a/cli/src/main.rs b/cli/src/main.rs index 026b11ed..4582fb7a 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -303,15 +303,16 @@ fn compile(mut command: CompileSettings) -> StrResult<()> { #[tracing::instrument(skip_all)] fn compile_once(world: &mut SystemWorld, command: &CompileSettings) -> StrResult { tracing::info!("Starting compilation"); - let start_time = std::time::Instant::now(); + let start = std::time::Instant::now(); status(command, Status::Compiling).unwrap(); world.reset(); world.main = world.resolve(&command.input).map_err(|err| err.to_string())?; let result = typst::compile(world); - let duration = start_time.elapsed(); + let duration = start.elapsed(); + match result { // Export the PDF / PNG. Ok(document) => { @@ -427,9 +428,9 @@ enum Status { impl Status { fn message(&self) -> String { match self { - Self::Compiling => "compiling ...".to_string(), + Self::Compiling => "compiling ...".into(), Self::Success(duration) => format!("compiled successfully in {duration:.2?}"), - Self::Error => "compiled with errors".to_string(), + Self::Error => "compiled with errors".into(), } } -- cgit v1.2.3