Skip to content

Commit 85afe8f

Browse files
committed
clippy
1 parent a3df62b commit 85afe8f

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

crates/enc-avfoundation/src/segmented.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ fn atomic_write_json<T: Serialize>(path: &Path, data: &T) -> std::io::Result<()>
2020

2121
std::fs::rename(&temp_path, path)?;
2222

23-
if let Some(parent) = path.parent() {
24-
if let Ok(dir) = std::fs::File::open(parent) {
25-
let _ = dir.sync_all();
26-
}
23+
if let Some(parent) = path.parent()
24+
&& let Ok(dir) = std::fs::File::open(parent)
25+
{
26+
let _ = dir.sync_all();
2727
}
2828

2929
Ok(())

crates/enc-ffmpeg/src/mux/segmented_audio.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,22 @@ fn atomic_write_json<T: Serialize>(path: &Path, data: &T) -> std::io::Result<()>
2222
if let Some(parent) = path.parent()
2323
&& let Ok(dir) = std::fs::File::open(parent)
2424
{
25-
let _ = dir.sync_all();
25+
if let Err(e) = dir.sync_all() {
26+
tracing::warn!(
27+
"Directory fsync failed after rename for {}: {e}",
28+
parent.display()
29+
);
30+
}
2631
}
2732

2833
Ok(())
2934
}
3035

3136
fn sync_file(path: &Path) {
3237
if let Ok(file) = std::fs::File::open(path) {
33-
let _ = file.sync_all();
38+
if let Err(e) = file.sync_all() {
39+
tracing::warn!("File fsync failed for {}: {e}", path.display());
40+
}
3441
}
3542
}
3643

0 commit comments

Comments
 (0)