Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

clippy

Richie McIlroy85afe8fbc8dc
diff --git a/crates/enc-avfoundation/src/segmented.rs b/crates/enc-avfoundation/src/segmented.rs
index 0dfc06b2e..c1053a960 100644
--- a/crates/enc-avfoundation/src/segmented.rs
+++ b/crates/enc-avfoundation/src/segmented.rs
@@ -20,10 +20,10 @@ fn atomic_write_json<T: Serialize>(path: &Path, data: &T) -> std::io::Result<()>
std::fs::rename(&temp_path, path)?;
- if let Some(parent) = path.parent() {
- if let Ok(dir) = std::fs::File::open(parent) {
- let _ = dir.sync_all();
- }
+ if let Some(parent) = path.parent()
+ && let Ok(dir) = std::fs::File::open(parent)
+ {
+ let _ = dir.sync_all();
}
Ok(())
diff --git a/crates/enc-ffmpeg/src/mux/segmented_audio.rs b/crates/enc-ffmpeg/src/mux/segmented_audio.rs
index 3b27e49d2..4ab6f083d 100644
--- a/crates/enc-ffmpeg/src/mux/segmented_audio.rs
+++ b/crates/enc-ffmpeg/src/mux/segmented_audio.rs
@@ -22,7 +22,12 @@ fn atomic_write_json<T: Serialize>(path: &Path, data: &T) -> std::io::Result<()>
if let Some(parent) = path.parent()
&& let Ok(dir) = std::fs::File::open(parent)
{
- let _ = dir.sync_all();
+ if let Err(e) = dir.sync_all() {
+ tracing::warn!(
+ "Directory fsync failed after rename for {}: {e}",
+ parent.display()
+ );
+ }
}
Ok(())
@@ -30,7 +35,9 @@ fn atomic_write_json<T: Serialize>(path: &Path, data: &T) -> std::io::Result<()>
fn sync_file(path: &Path) {
if let Ok(file) = std::fs::File::open(path) {
- let _ = file.sync_all();
+ if let Err(e) = file.sync_all() {
+ tracing::warn!("File fsync failed for {}: {e}", path.display());
+ }
}
}