We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e81d71c commit 990bd0cCopy full SHA for 990bd0c
src/compile.rs
@@ -443,14 +443,8 @@ fn cargo_build_command(
443
fs::create_dir_all(&maturin_target_dir)?;
444
// We don't want to rewrite the file every time as that will make cargo
445
// trigger a rebuild of the project every time
446
- let rewrite = if config_file.exists() {
447
- std::fs::read_to_string(&config_file)
448
- .map(|previous| previous != pyo3_config)
449
- .unwrap_or(false)
450
- } else {
451
- true
452
- };
453
- if rewrite {
+ let existing_pyo3_config = fs::read_to_string(&config_file).unwrap_or_default()
+ if pyo3_config != existing_pyo3_config {
454
fs::write(&config_file, pyo3_config).with_context(|| {
455
format!(
456
"Failed to create pyo3 config file at '{}'",
0 commit comments