mirror of
https://github.com/Cuprate/cuprate.git
synced 2025-04-16 11:11:54 +00:00
parent
24265ac43c
commit
91099846d6
1 changed files with 1 additions and 4 deletions
|
@ -46,10 +46,7 @@ pub(crate) fn save_peers_to_disk<Z: BorshNetworkZone>(
|
|||
|
||||
spawn_blocking(move || {
|
||||
fs::create_dir_all(dir)?;
|
||||
match fs::write(&tmp_file, &data) {
|
||||
Ok(_) => fs::rename(tmp_file, file),
|
||||
Err(x) => Err(x),
|
||||
}
|
||||
fs::write(&tmp_file, &data).and_then(|()| fs::rename(tmp_file, file))
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue