safe_write: no unused import on wasm
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AS5Tn3xieewUSg3uxrMVdL
This commit is contained in:
1 parent
f40356a74f
commit
bdb27a1e93
1 file changed
+2
-2
@@ -3,7 +3,7 @@
|
|||||||
//! leaves the old file or the new one, never a torn mix. The previous version can be kept as
|
//! leaves the old file or the new one, never a torn mix. The previous version can be kept as
|
||||||
//! `<file>.bak` (itself written the same way).
|
//! `<file>.bak` (itself written the same way).
|
||||||
|
|
||||||
use std::fs::{self, File, OpenOptions};
|
use std::fs::{self, OpenOptions};
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ fn write_synced(path: &Path, bytes: &[u8]) -> std::io::Result<()> {
|
|||||||
fn sync_dir(path: &Path) {
|
fn sync_dir(path: &Path) {
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
if let Some(dir) = path.parent().filter(|d| !d.as_os_str().is_empty())
|
if let Some(dir) = path.parent().filter(|d| !d.as_os_str().is_empty())
|
||||||
&& let Ok(d) = File::open(dir)
|
&& let Ok(d) = fs::File::open(dir)
|
||||||
{
|
{
|
||||||
let _ = d.sync_all();
|
let _ = d.sync_all();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user