Skip to content

Commit

Permalink
fix: use File::sync_all API for closing registry file
Browse files Browse the repository at this point in the history
  • Loading branch information
paolobarbolini committed Apr 6, 2024
1 parent 56473fe commit 510605d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl RegistryCrate {

let mut tmp_crate_file = File::create(&tmp_crate_path)?;
io::copy(&mut resp, &mut tmp_crate_file)?;
tmp_crate_file.flush()?;
tmp_crate_file.sync_all()?;
drop(tmp_crate_file);

fs::rename(tmp_crate_path, &crate_path)?;
Expand Down

0 comments on commit 510605d

Please sign in to comment.