summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-06-24 15:05:59 +0200
committerLaurenz <laurmaedje@gmail.com>2023-06-24 15:05:59 +0200
commitf1025071edfb787309a75d4bb68bec0c2bd906bb (patch)
treeb28d6cf05b8a8f29acbfb44093e3c9bface802b6 /cli
parentb96b7b7ee12a5d1c8e8c24c95b58b7ca03cec44b (diff)
Tidy up
Diffstat (limited to 'cli')
-rw-r--r--cli/src/main.rs9
1 files changed, 5 insertions, 4 deletions
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<bool> {
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(),
}
}