We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 24265ac commit 9109984Copy full SHA for 9109984
1 file changed
p2p/address-book/src/store.rs
@@ -46,10 +46,7 @@ pub(crate) fn save_peers_to_disk<Z: BorshNetworkZone>(
46
47
spawn_blocking(move || {
48
fs::create_dir_all(dir)?;
49
- match fs::write(&tmp_file, &data) {
50
- Ok(_) => fs::rename(tmp_file, file),
51
- Err(x) => Err(x),
52
- }
+ fs::write(&tmp_file, &data).and_then(|()| fs::rename(tmp_file, file))
53
})
54
}
55
0 commit comments