Skip to content

Commit ddfe183

Browse files
committed
clippy
1 parent 344956b commit ddfe183

File tree

3 files changed

+19
-18
lines changed

3 files changed

+19
-18
lines changed

crates/frame-converter/src/d3d11.rs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ impl FrameConverter for D3D11Converter {
815815
.fetch_add(elapsed_ns, Ordering::Relaxed);
816816

817817
let frame_count = count + 1;
818-
if frame_count % 300 == 0 {
818+
if frame_count.is_multiple_of(300) {
819819
let total_ns = self.total_conversion_time_ns.load(Ordering::Relaxed);
820820
let avg_ms = (total_ns as f64 / frame_count as f64) / 1_000_000.0;
821821
tracing::debug!(
@@ -1145,19 +1145,17 @@ unsafe impl Sync for D3D11Converter {}
11451145
impl Drop for D3D11Resources {
11461146
fn drop(&mut self) {
11471147
unsafe {
1148-
if let Some(handle) = self.input_shared_handle.take() {
1149-
if !handle.is_invalid() {
1150-
if let Err(e) = CloseHandle(handle) {
1151-
tracing::error!("Failed to close input shared handle: {:?}", e);
1152-
}
1153-
}
1148+
if let Some(handle) = self.input_shared_handle.take()
1149+
&& !handle.is_invalid()
1150+
&& let Err(e) = CloseHandle(handle)
1151+
{
1152+
tracing::error!("Failed to close input shared handle: {:?}", e);
11541153
}
1155-
if let Some(handle) = self.output_shared_handle.take() {
1156-
if !handle.is_invalid() {
1157-
if let Err(e) = CloseHandle(handle) {
1158-
tracing::error!("Failed to close output shared handle: {:?}", e);
1159-
}
1160-
}
1154+
if let Some(handle) = self.output_shared_handle.take()
1155+
&& !handle.is_invalid()
1156+
&& let Err(e) = CloseHandle(handle)
1157+
{
1158+
tracing::error!("Failed to close output shared handle: {:?}", e);
11611159
}
11621160
}
11631161
}

crates/rendering/src/decoder/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ use std::{
66
time::Duration,
77
};
88
use tokio::sync::oneshot;
9-
use tracing::{debug, info, warn};
9+
#[cfg(target_os = "windows")]
10+
use tracing::warn;
11+
use tracing::{debug, info};
1012

1113
#[cfg(target_os = "macos")]
1214
mod avassetreader;

crates/scap-direct3d/src/lib.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,11 @@ impl StagingTexturePool {
105105

106106
let index = self.next_index.fetch_add(1, Ordering::Relaxed) % STAGING_POOL_SIZE;
107107

108-
if let Some(pooled) = textures.get(index) {
109-
if pooled.width == width && pooled.height == height {
110-
return Ok(pooled.texture.clone());
111-
}
108+
if let Some(pooled) = textures.get(index)
109+
&& pooled.width == width
110+
&& pooled.height == height
111+
{
112+
return Ok(pooled.texture.clone());
112113
}
113114

114115
let texture_desc = D3D11_TEXTURE2D_DESC {

0 commit comments

Comments
 (0)