Fixed panic when target file was already built.

This commit is contained in:
Filipe Rodrigues 2023-01-01 21:59:25 +00:00
parent f2a7a51439
commit 4c0e3cfe18

View File

@ -88,7 +88,7 @@ use {
collections::HashMap,
env,
path::{Path, PathBuf},
time::SystemTime,
time::{Duration, SystemTime},
},
tokio::fs,
watcher::Watcher,
@ -245,7 +245,7 @@ async fn build_target<T: BuildableTargetInner + std::fmt::Display>(
let build_duration = build_res
.build_time
.duration_since(build_start_time)
.expect("Build time was negative");
.unwrap_or(Duration::ZERO);
tracing::info!("Built target {target} in {build_duration:.2?}");
},
Err(err) => tracing::error!("Unable to build target {target}: {:?}", anyhow::Error::new(err)),