File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ fn main() {
3535
3636 // NOTE: Since `./configure` generates a `config.toml`, distro maintainers will see the
3737 // changelog warning, not the `x.py setup` message.
38- let suggest_setup = ! config. config . exists ( ) && !matches ! ( config. cmd, Subcommand :: Setup { .. } ) ;
38+ let suggest_setup = config. config . is_none ( ) && !matches ! ( config. cmd, Subcommand :: Setup { .. } ) ;
3939 if suggest_setup {
4040 println ! ( "warning: you have not made a `config.toml`" ) ;
4141 println ! (
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ pub struct Config {
8080 pub keep_stage_std : Vec < u32 > ,
8181 pub src : PathBuf ,
8282 /// defaults to `config.toml`
83- pub config : PathBuf ,
83+ pub config : Option < PathBuf > ,
8484 pub jobs : Option < u32 > ,
8585 pub cmd : Subcommand ,
8686 pub incremental : bool ,
@@ -942,7 +942,7 @@ impl Config {
942942 }
943943
944944 config. changelog_seen = toml. changelog_seen ;
945- config. config = toml_path;
945+ config. config = if toml_path. exists ( ) { Some ( toml_path ) } else { None } ;
946946
947947 let build = toml. build . unwrap_or_default ( ) ;
948948
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ impl fmt::Display for Profile {
8282}
8383
8484pub fn setup ( config : & Config , profile : Profile ) {
85- let path = & config. config ;
85+ let path = & config. config . clone ( ) . unwrap_or ( PathBuf :: from ( "config.toml" ) ) ;
8686
8787 if path. exists ( ) {
8888 eprintln ! (
You can’t perform that action at this time.
0 commit comments