File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -977,6 +977,7 @@ pub(crate) fn should_refresh_for_change(
977977 change_kind : ChangeKind ,
978978 additional_paths : & [ & str ] ,
979979) -> bool {
980+ // Note: build scripts are retriggered on file save, no refresh is necessary
980981 const IMPLICIT_TARGET_FILES : & [ & str ] = & [ "build.rs" , "src/main.rs" , "src/lib.rs" ] ;
981982 const IMPLICIT_TARGET_DIRS : & [ & str ] = & [ "src/bin" , "examples" , "tests" , "benches" ] ;
982983
@@ -993,15 +994,20 @@ pub(crate) fn should_refresh_for_change(
993994 return true ;
994995 }
995996
997+ // .cargo/config{.toml}
998+ if matches ! ( file_name, "config.toml" | "config" )
999+ && path. parent ( ) . map ( |parent| parent. as_str ( ) . ends_with ( ".cargo" ) ) . unwrap_or ( false )
1000+ {
1001+ return true ;
1002+ }
1003+
1004+ // Everything below only matters when files are created or deleted
9961005 if change_kind == ChangeKind :: Modify {
9971006 return false ;
9981007 }
9991008
1000- // .cargo/config{.toml}
10011009 if path. extension ( ) . unwrap_or_default ( ) != "rs" {
1002- let is_cargo_config = matches ! ( file_name, "config.toml" | "config" )
1003- && path. parent ( ) . map ( |parent| parent. as_str ( ) . ends_with ( ".cargo" ) ) . unwrap_or ( false ) ;
1004- return is_cargo_config;
1010+ return false ;
10051011 }
10061012
10071013 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