Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

clippy bits

Richie McIlroye0fab010a9d9
diff --git a/crates/recording/src/feeds/camera.rs b/crates/recording/src/feeds/camera.rs
index effe43bc0..80ca51c4a 100644
--- a/crates/recording/src/feeds/camera.rs
+++ b/crates/recording/src/feeds/camera.rs
@@ -669,12 +669,12 @@ impl Message<LockedCameraInputReconnected> for CameraFeed {
msg: LockedCameraInputReconnected,
_: &mut Context<Self, Self::Reply>,
) -> Self::Reply {
- if let State::Locked { inner } = &mut self.state {
- if inner.id == msg.id {
- inner.camera_info = msg.camera_info;
- inner.video_info = msg.video_info;
- inner.done_tx = msg.done_tx;
- }
+ if let State::Locked { inner } = &mut self.state
+ && inner.id == msg.id
+ {
+ inner.camera_info = msg.camera_info;
+ inner.video_info = msg.video_info;
+ inner.done_tx = msg.done_tx;
}
}
}
diff --git a/crates/recording/src/feeds/microphone.rs b/crates/recording/src/feeds/microphone.rs
index dcedb967d..4700fa162 100644
--- a/crates/recording/src/feeds/microphone.rs
+++ b/crates/recording/src/feeds/microphone.rs
@@ -806,13 +806,13 @@ impl Message<LockedInputReconnected> for MicrophoneFeed {
msg: LockedInputReconnected,
_: &mut Context<Self, Self::Reply>,
) -> Self::Reply {
- if let State::Locked { inner } = &mut self.state {
- if inner.label == msg.label {
- inner.id = msg.id;
- inner.config = msg.config;
- inner.buffer_size_frames = msg.buffer_size_frames;
- inner.done_tx = msg.done_tx;
- }
+ if let State::Locked { inner } = &mut self.state
+ && inner.label == msg.label
+ {
+ inner.id = msg.id;
+ inner.config = msg.config;
+ inner.buffer_size_frames = msg.buffer_size_frames;
+ inner.done_tx = msg.done_tx;
}
}
}
diff --git a/crates/recording/src/sources/audio_mixer.rs b/crates/recording/src/sources/audio_mixer.rs
index 48474d969..ee312c971 100644
--- a/crates/recording/src/sources/audio_mixer.rs
+++ b/crates/recording/src/sources/audio_mixer.rs
@@ -100,8 +100,7 @@ impl AudioMixerBuilder {
&ffmpeg::filter::find("aresample").expect("Failed to find aresample filter"),
&format!("resample{i}"),
&format!(
- "out_sample_rate={}:out_sample_fmt={}:out_chlayout=0x{:x}",
- target_rate, target_sample_fmt, target_channel_layout_bits
+ "out_sample_rate={target_rate}:out_sample_fmt={target_sample_fmt}:out_chlayout=0x{target_channel_layout_bits:x}"
),
)?;
@@ -118,8 +117,7 @@ impl AudioMixerBuilder {
)?;
let aformat_args = format!(
- "sample_fmts={}:sample_rates={}:channel_layouts=0x{:x}",
- target_sample_fmt, target_rate, target_channel_layout_bits
+ "sample_fmts={target_sample_fmt}:sample_rates={target_rate}:channel_layouts=0x{target_channel_layout_bits:x}"
);
let mut aformat = filter_graph.add(
diff --git a/crates/rendering/src/lib.rs b/crates/rendering/src/lib.rs
index 7ae4b6fba..4cd230eed 100644
--- a/crates/rendering/src/lib.rs
+++ b/crates/rendering/src/lib.rs
@@ -427,7 +427,7 @@ impl MotionBounds {
&& self.end.coord.y >= other.end.coord.y
}
- fn to_uv(&self, point: XY<f64>) -> XY<f32> {
+ fn point_to_uv(&self, point: XY<f64>) -> XY<f32> {
let size = self.size();
XY::new(
((point.x - self.start.coord.x) / size.x.max(f64::EPSILON)) as f32,
@@ -513,7 +513,7 @@ fn analyze_motion(current: &MotionBounds, previous: &MotionBounds) -> MotionAnal
analysis.movement_uv = movement_uv;
analysis.movement_magnitude = movement_magnitude;
analysis.zoom_magnitude = zoom_magnitude;
- analysis.zoom_center_uv = current.to_uv(zoom_center_point);
+ analysis.zoom_center_uv = current.point_to_uv(zoom_center_point);
analysis
}
diff --git a/crates/rendering/src/main.rs b/crates/rendering/src/main.rs
index 9f98d9459..afdde2020 100644
--- a/crates/rendering/src/main.rs
+++ b/crates/rendering/src/main.rs
@@ -149,7 +149,7 @@ async fn main() -> Result<()> {
OutputFormat::Jpeg => "jpg",
OutputFormat::Raw => "raw",
};
- PathBuf::from(format!("frame.{}", extension))
+ PathBuf::from(format!("frame.{extension}"))
});
// Ensure output directory exists