Skip to content

Prevent failure in case there is no config.toml file #73651

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,7 @@ impl Config {

let toml = file
.map(|file| {
let contents = t!(fs::read_to_string(&file));
match toml::from_str(&contents) {
fs::read_to_string(&file).ok().map(|contents| match toml::from_str(&contents) {
Ok(table) => table,
Err(err) => {
println!(
Expand All @@ -455,8 +454,9 @@ impl Config {
);
process::exit(2);
}
}
})
})
.flatten()
.unwrap_or_else(TomlConfig::default);

let build = toml.build.clone().unwrap_or_default();
Expand Down