Skip to content

Commit 66ec5bb

Browse files
committed
clippy
1 parent 774596a commit 66ec5bb

File tree

5 files changed

+41
-46
lines changed

5 files changed

+41
-46
lines changed

crates/recording/src/output_pipeline/win_segmented.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -579,18 +579,17 @@ impl VideoMuxer for WindowsSegmentedMuxer {
579579
self.rotate_segment(adjusted_timestamp)?;
580580
}
581581

582-
if let Some(state) = &self.current_state {
583-
if let Err(e) = state
582+
if let Some(state) = &self.current_state
583+
&& let Err(e) = state
584584
.video_tx
585585
.try_send(Some((frame.frame, adjusted_timestamp)))
586-
{
587-
match e {
588-
std::sync::mpsc::TrySendError::Full(_) => {
589-
trace!("Screen encoder channel full, dropping frame");
590-
}
591-
std::sync::mpsc::TrySendError::Disconnected(_) => {
592-
trace!("Screen encoder channel disconnected");
593-
}
586+
{
587+
match e {
588+
std::sync::mpsc::TrySendError::Full(_) => {
589+
trace!("Screen encoder channel full, dropping frame");
590+
}
591+
std::sync::mpsc::TrySendError::Disconnected(_) => {
592+
trace!("Screen encoder channel disconnected");
594593
}
595594
}
596595
}

crates/recording/src/output_pipeline/win_segmented_camera.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -533,15 +533,15 @@ impl VideoMuxer for WindowsSegmentedCameraMuxer {
533533
self.rotate_segment(adjusted_timestamp, &frame)?;
534534
}
535535

536-
if let Some(state) = &self.current_state {
537-
if let Err(e) = state.video_tx.try_send(Some((frame, adjusted_timestamp))) {
538-
match e {
539-
std::sync::mpsc::TrySendError::Full(_) => {
540-
trace!("Camera encoder channel full, dropping frame");
541-
}
542-
std::sync::mpsc::TrySendError::Disconnected(_) => {
543-
trace!("Camera encoder channel disconnected");
544-
}
536+
if let Some(state) = &self.current_state
537+
&& let Err(e) = state.video_tx.try_send(Some((frame, adjusted_timestamp)))
538+
{
539+
match e {
540+
std::sync::mpsc::TrySendError::Full(_) => {
541+
trace!("Camera encoder channel full, dropping frame");
542+
}
543+
std::sync::mpsc::TrySendError::Disconnected(_) => {
544+
trace!("Camera encoder channel disconnected");
545545
}
546546
}
547547
}

crates/rendering/src/d3d_texture.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -200,21 +200,17 @@ mod windows_impl {
200200
))
201201
}
202202

203+
#[derive(Default)]
203204
pub struct D3D11WgpuInterop {
204-
cached_width: u32,
205-
cached_height: u32,
206-
y_wgpu_texture: Option<wgpu::Texture>,
207-
uv_wgpu_texture: Option<wgpu::Texture>,
205+
_cached_width: u32,
206+
_cached_height: u32,
207+
_y_wgpu_texture: Option<wgpu::Texture>,
208+
_uv_wgpu_texture: Option<wgpu::Texture>,
208209
}
209210

210211
impl D3D11WgpuInterop {
211212
pub fn new() -> Self {
212-
Self {
213-
cached_width: 0,
214-
cached_height: 0,
215-
y_wgpu_texture: None,
216-
uv_wgpu_texture: None,
217-
}
213+
Self::default()
218214
}
219215

220216
#[allow(unused_variables)]

crates/rendering/src/decoder/media_foundation.rs

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ use super::{DecodedFrame, FRAME_CACHE_SIZE, VideoDecoderMessage};
1212
#[derive(Clone)]
1313
struct CachedFrame {
1414
number: u32,
15-
texture: ID3D11Texture2D,
16-
shared_handle: Option<HANDLE>,
17-
y_handle: Option<HANDLE>,
18-
uv_handle: Option<HANDLE>,
15+
_texture: ID3D11Texture2D,
16+
_shared_handle: Option<HANDLE>,
17+
_y_handle: Option<HANDLE>,
18+
_uv_handle: Option<HANDLE>,
1919
nv12_data: Option<Arc<cap_video_decode::NV12Data>>,
2020
width: u32,
2121
height: u32,
@@ -154,10 +154,10 @@ impl MFDecoder {
154154

155155
let cached = CachedFrame {
156156
number: frame_number,
157-
texture: mf_frame.texture,
158-
shared_handle: mf_frame.shared_handle,
159-
y_handle: mf_frame.y_handle,
160-
uv_handle: mf_frame.uv_handle,
157+
_texture: mf_frame.texture,
158+
_shared_handle: mf_frame.shared_handle,
159+
_y_handle: mf_frame.y_handle,
160+
_uv_handle: mf_frame.uv_handle,
161161
nv12_data,
162162
width: mf_frame.width,
163163
height: mf_frame.height,
@@ -190,15 +190,14 @@ impl MFDecoder {
190190
.or_else(|| cache.get(&frame_number))
191191
};
192192

193-
if let Some(frame) = frame_to_send {
194-
if let Some(s) = sender.take() {
195-
if s.send(frame.to_decoded_frame()).is_err() {
196-
warn!(
197-
"Failed to send frame {}: receiver dropped",
198-
frame.number
199-
);
200-
}
201-
}
193+
if let Some(frame) = frame_to_send
194+
&& let Some(s) = sender.take()
195+
&& s.send(frame.to_decoded_frame()).is_err()
196+
{
197+
warn!(
198+
"Failed to send frame {}: receiver dropped",
199+
frame.number
200+
);
202201
}
203202
break;
204203
}

crates/rendering/src/yuv_converter.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,7 @@ impl YuvToRgbaConverter {
641641
}
642642

643643
#[cfg(target_os = "windows")]
644+
#[allow(clippy::too_many_arguments)]
644645
pub fn convert_nv12_from_d3d11_texture(
645646
&mut self,
646647
wgpu_device: &wgpu::Device,

0 commit comments

Comments
 (0)