From 6114daac164f4f7ec358a299e9b8ce700616330b Mon Sep 17 00:00:00 2001 From: Yasunobu <42543015+P4suta@users.noreply.github.com> Date: Sat, 19 Sep 2026 20:09:31 +0900 Subject: [PATCH] fix: avoid unused path warning on non-Unix --- rust/ocomment/src/atomic.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/rust/ocomment/src/atomic.rs b/rust/ocomment/src/atomic.rs index 446f09e..d2fdbdc 100644 --- a/rust/ocomment/src/atomic.rs +++ b/rust/ocomment/src/atomic.rs @@ -161,12 +161,15 @@ fn reject_symlink(path: &Path, phase: &str) -> Result<()> { Ok(()) } +#[cfg(unix)] fn sync_parent(path: &Path) -> Result<()> { - #[cfg(unix)] - { - let directory = fs::File::open(parent_directory(path))?; - directory.sync_all()?; - } + let directory = fs::File::open(parent_directory(path))?; + directory.sync_all()?; + Ok(()) +} + +#[cfg(not(unix))] +fn sync_parent(_: &Path) -> Result<()> { Ok(()) }