@@ -368,12 +368,11 @@ pub fn compile(
368368 // so editor tooling can surface it from .compiler.log
369369 let mut touched_packages = AHashSet :: < String > :: new ( ) ;
370370 for module_name in cycle. iter ( ) {
371- if let Some ( module) = build_state. get_module ( module_name) {
372- if touched_packages. insert ( module. package_name . clone ( ) ) {
373- if let Some ( package) = build_state. get_package ( & module. package_name ) {
374- logs:: append ( package, & message) ;
375- }
376- }
371+ if let Some ( module) = build_state. get_module ( module_name)
372+ && touched_packages. insert ( module. package_name . clone ( ) )
373+ && let Some ( package) = build_state. get_package ( & module. package_name )
374+ {
375+ logs:: append ( package, & message) ;
377376 }
378377 }
379378
@@ -795,24 +794,23 @@ fn compile_file(
795794
796795 // copy js file
797796 root_config. get_package_specs ( ) . iter ( ) . for_each ( |spec| {
798- if spec. in_source {
799- if let SourceType :: SourceFile ( SourceFile {
797+ if spec. in_source
798+ && let SourceType :: SourceFile ( SourceFile {
800799 implementation : Implementation { path, .. } ,
801800 ..
802801 } ) = & module. source_type
803- {
804- let source = helpers:: get_source_file_from_rescript_file (
805- & Path :: new ( & package. path ) . join ( path) ,
806- & root_config. get_suffix ( spec) ,
807- ) ;
808- let destination = helpers:: get_source_file_from_rescript_file (
809- & package. get_build_path ( ) . join ( path) ,
810- & root_config. get_suffix ( spec) ,
811- ) ;
812-
813- if source. exists ( ) {
814- let _ = std:: fs:: copy ( & source, & destination) . expect ( "copying source file failed" ) ;
815- }
802+ {
803+ let source = helpers:: get_source_file_from_rescript_file (
804+ & Path :: new ( & package. path ) . join ( path) ,
805+ & root_config. get_suffix ( spec) ,
806+ ) ;
807+ let destination = helpers:: get_source_file_from_rescript_file (
808+ & package. get_build_path ( ) . join ( path) ,
809+ & root_config. get_suffix ( spec) ,
810+ ) ;
811+
812+ if source. exists ( ) {
813+ let _ = std:: fs:: copy ( & source, & destination) . expect ( "copying source file failed" ) ;
816814 }
817815 }
818816 } ) ;
@@ -912,10 +910,9 @@ pub fn mark_modules_with_expired_deps_dirty(build_state: &mut BuildCommandState)
912910
913911 if let ( Some ( last_compiled_dependent) , Some ( last_compiled) ) =
914912 ( dependent_module. last_compiled_cmt , module. last_compiled_cmt )
913+ && last_compiled_dependent < last_compiled
915914 {
916- if last_compiled_dependent < last_compiled {
917- modules_with_expired_deps. insert ( dependent. to_string ( ) ) ;
918- }
915+ modules_with_expired_deps. insert ( dependent. to_string ( ) ) ;
919916 }
920917 }
921918 }
0 commit comments