File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -975,6 +975,7 @@ pub(crate) fn should_refresh_for_change(
975975 change_kind : ChangeKind ,
976976 additional_paths : & [ & str ] ,
977977) -> bool {
978+ // Note: build scripts are retriggered on file save, no refresh is necessary
978979 const IMPLICIT_TARGET_FILES : & [ & str ] = & [ "build.rs" , "src/main.rs" , "src/lib.rs" ] ;
979980 const IMPLICIT_TARGET_DIRS : & [ & str ] = & [ "src/bin" , "examples" , "tests" , "benches" ] ;
980981
@@ -991,15 +992,20 @@ pub(crate) fn should_refresh_for_change(
991992 return true ;
992993 }
993994
995+ // .cargo/config{.toml}
996+ if matches ! ( file_name, "config.toml" | "config" )
997+ && path. parent ( ) . map ( |parent| parent. as_str ( ) . ends_with ( ".cargo" ) ) . unwrap_or ( false )
998+ {
999+ return true ;
1000+ }
1001+
1002+ // Everything below only matters when files are created or deleted
9941003 if change_kind == ChangeKind :: Modify {
9951004 return false ;
9961005 }
9971006
998- // .cargo/config{.toml}
9991007 if path. extension ( ) . unwrap_or_default ( ) != "rs" {
1000- let is_cargo_config = matches ! ( file_name, "config.toml" | "config" )
1001- && path. parent ( ) . map ( |parent| parent. as_str ( ) . ends_with ( ".cargo" ) ) . unwrap_or ( false ) ;
1002- return is_cargo_config;
1008+ return false ;
10031009 }
10041010
10051011 if IMPLICIT_TARGET_FILES . iter ( ) . any ( |it| path. as_str ( ) . ends_with ( it) ) {
You can’t perform that action at this time.
0 commit comments