Skip to content

Commit 6edcee7

Browse files
committed
clippy
1 parent 187bc33 commit 6edcee7

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

crates/enc-mediafoundation/src/media.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ unsafe fn MFSetAttribute2UINT32asUINT64(
2222
unsafe { attributes.SetUINT64(key, pack_2_u32_as_u64(high, low)) }
2323
}
2424

25-
#[allow(non_snake_case)]
25+
#[allow(non_snake_case, clippy::missing_safety_doc)]
2626
pub unsafe fn MFSetAttributeSize(
2727
attributes: &IMFAttributes,
2828
key: &GUID,
@@ -32,7 +32,7 @@ pub unsafe fn MFSetAttributeSize(
3232
unsafe { MFSetAttribute2UINT32asUINT64(attributes, key, width, height) }
3333
}
3434

35-
#[allow(non_snake_case)]
35+
#[allow(non_snake_case, clippy::missing_safety_doc)]
3636
pub unsafe fn MFSetAttributeRatio(
3737
attributes: &IMFAttributes,
3838
key: &GUID,

crates/enc-mediafoundation/src/video/h264.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ pub enum HandleNeedsInputError {
101101
unsafe impl Send for H264Encoder {}
102102

103103
impl H264Encoder {
104+
#[allow(clippy::too_many_arguments)]
104105
fn new_with_scaled_output_with_flags(
105106
d3d_device: &ID3D11Device,
106107
format: DXGI_FORMAT,
@@ -210,7 +211,10 @@ impl H264Encoder {
210211
unsafe {
211212
let temp = media_device_manager.clone();
212213
transform
213-
.ProcessMessage(MFT_MESSAGE_SET_D3D_MANAGER, std::mem::transmute(temp))
214+
.ProcessMessage(
215+
MFT_MESSAGE_SET_D3D_MANAGER,
216+
std::mem::transmute::<_, usize>(temp),
217+
)
214218
.map_err(NewVideoEncoderError::EncoderTransform)?;
215219
};
216220

crates/mediafoundation-ffmpeg/src/audio.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ impl AudioExt for ffmpeg::frame::Audio {
2222
unsafe { buffer.Lock(&mut buffer_ptr, None, None)? };
2323

2424
unsafe {
25-
std::ptr::copy_nonoverlapping(self.data(0).as_ptr(), buffer_ptr, length as usize);
25+
std::ptr::copy_nonoverlapping(self.data(0).as_ptr(), buffer_ptr, length);
2626
}
2727

2828
unsafe { buffer.SetCurrentLength(length as u32)? }

crates/recording/src/screenshot.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ pub async fn capture_screenshot(target: ScreenCaptureTarget) -> anyhow::Result<R
640640
}
641641

642642
#[cfg(target_os = "windows")]
643-
let mut cropped_in_capture = false;
643+
let cropped_in_capture;
644644

645645
let (tx, rx) = oneshot::channel::<anyhow::Result<RgbImage>>();
646646
let tx = Arc::new(Mutex::new(Some(tx)));

crates/recording/src/sources/screen_capture/windows.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use cap_media_info::{AudioInfo, VideoInfo};
88
use cap_timestamp::{PerformanceCounterTimestamp, Timestamp};
99
use cpal::traits::{DeviceTrait, HostTrait};
1010
use futures::{
11-
FutureExt, SinkExt, StreamExt,
11+
FutureExt, StreamExt,
1212
channel::{mpsc, oneshot},
1313
};
1414
use scap_ffmpeg::*;
@@ -201,7 +201,7 @@ impl output_pipeline::VideoSource for VideoSource {
201201
}
202202
},
203203
{
204-
let error_tx = error_tx.clone();
204+
let mut error_tx = error_tx.clone();
205205
move || {
206206
drop(error_tx.try_send(anyhow!("closed")));
207207

0 commit comments

Comments
 (0)