Skip to content

Commit

Permalink
🚨 - Cargo FMT
Browse files Browse the repository at this point in the history
  • Loading branch information
Roland Peelen committed Apr 12, 2024
1 parent cad838d commit fefc066
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
26 changes: 13 additions & 13 deletions src/build/read_compile_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,19 @@ pub fn read(build_state: &mut BuildState) -> CompileAssetsState {
.get(&build_state.root_config_name)
.expect("Could not find root package");
if let Some(res_file_path) = res_file_path {
let _ = ast_modules.insert(
res_file_path.to_owned(),
AstModule {
module_name,
package_name: package_name.to_owned(),
namespace: package_namespace.to_owned(),
last_modified: last_modified.to_owned(),
ast_file_path,
is_root: *package_is_root,
suffix: root_package.bsconfig.suffix.to_owned(),
},
);
let _ = ast_rescript_file_locations.insert(res_file_path);
let _ = ast_modules.insert(
res_file_path.to_owned(),
AstModule {
module_name,
package_name: package_name.to_owned(),
namespace: package_namespace.to_owned(),
last_modified: last_modified.to_owned(),
ast_file_path,
is_root: *package_is_root,
suffix: root_package.bsconfig.suffix.to_owned(),
},
);
let _ = ast_rescript_file_locations.insert(res_file_path);
}
}
"cmi" => {
Expand Down
11 changes: 7 additions & 4 deletions src/watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,10 @@ async fn async_watch(
match needs_compile_type {
CompileType::Incremental => {
let timing_total = Instant::now();
if build::incremental_build(&mut build_state, None, initial_build, !initial_build).is_ok()
{
if let Some(a) = after_build.clone() { cmd::run(a) }
if build::incremental_build(&mut build_state, None, initial_build, !initial_build).is_ok() {
if let Some(a) = after_build.clone() {
cmd::run(a)
}
let timing_total_elapsed = timing_total.elapsed();
println!(
"\n{}{}Finished {} compilation in {:.2}s\n",
Expand All @@ -197,7 +198,9 @@ async fn async_watch(
let timing_total = Instant::now();
build_state = build::initialize_build(None, filter, path).expect("Can't initialize build");
let _ = build::incremental_build(&mut build_state, None, initial_build, false);
if let Some(a) = after_build.clone() { cmd::run(a) }
if let Some(a) = after_build.clone() {
cmd::run(a)
}
let timing_total_elapsed = timing_total.elapsed();
println!(
"\n{}{}Finished compilation in {:.2}s\n",
Expand Down

0 comments on commit fefc066

Please sign in to comment.