Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

clippy

Richie McIlroy672eac256538
diff --git a/crates/recording/src/output_pipeline/core.rs b/crates/recording/src/output_pipeline/core.rs
index 737cb368a..b184cc0be 100644
--- a/crates/recording/src/output_pipeline/core.rs
+++ b/crates/recording/src/output_pipeline/core.rs
@@ -419,7 +419,7 @@ impl TimestampAnomalyTracker {
jump_secs: f64,
now: Instant,
) -> Result<Duration, TimestampAnomalyError> {
- let wall_clock_confirmed = self.last_valid_wall_clock.map_or(false, |last_wc| {
+ let wall_clock_confirmed = self.last_valid_wall_clock.is_some_and(|last_wc| {
let wall_clock_gap_secs = now.duration_since(last_wc).as_secs_f64();
wall_clock_gap_secs >= jump_secs * 0.5
});
diff --git a/crates/recording/src/output_pipeline/macos.rs b/crates/recording/src/output_pipeline/macos.rs
index 5a190257a..dc03b7a51 100644
--- a/crates/recording/src/output_pipeline/macos.rs
+++ b/crates/recording/src/output_pipeline/macos.rs
@@ -34,7 +34,7 @@ fn get_available_disk_space_mb(path: &std::path::Path) -> Option<u64> {
if result != 0 {
return None;
}
- Some((stat.f_bavail as u64).saturating_mul(stat.f_frsize as u64) / (1024 * 1024))
+ Some((stat.f_bavail as u64).saturating_mul(stat.f_frsize) / (1024 * 1024))
}
fn get_mp4_muxer_buffer_size(instant_mode: bool) -> usize {
diff --git a/crates/recording/src/sources/camera.rs b/crates/recording/src/sources/camera.rs
index db0fa42b9..aede5e52d 100644
--- a/crates/recording/src/sources/camera.rs
+++ b/crates/recording/src/sources/camera.rs
@@ -133,7 +133,7 @@ impl VideoSource for Camera {
if frame_width != original_width || frame_height != original_height {
let needs_new_scaler = scaler
.as_ref()
- .map_or(true, |s| !s.matches_source(frame_width, frame_height));
+ .is_none_or(|s| !s.matches_source(frame_width, frame_height));
if needs_new_scaler {
let frame_format = frame.inner.format();
diff --git a/crates/recording/src/sources/microphone.rs b/crates/recording/src/sources/microphone.rs
index 3e8b6247f..4bdd47522 100644
--- a/crates/recording/src/sources/microphone.rs
+++ b/crates/recording/src/sources/microphone.rs
@@ -299,12 +299,10 @@ impl AudioSource for Microphone {
silence_counter.fetch_add(1, Ordering::Relaxed);
- match tokio::time::timeout(send_timeout, audio_tx.send(audio_frame))
- .await
- {
- Ok(Ok(())) => {}
- _ => {}
- }
+ if let Ok(Ok(())) =
+ tokio::time::timeout(send_timeout, audio_tx.send(audio_frame))
+ .await
+ {}
}
}
}