fix clippy warnings ()

fix clippy
This commit is contained in:
Boog900 2025-04-10 21:58:56 +01:00 committed by GitHub
parent 24265ac43c
commit 91099846d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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))
})
}