From d12d9f479beb8a1bc2f56628b7e3da7640a3be31 Mon Sep 17 00:00:00 2001 From: Viktor Lazarev Date: Thu, 29 Aug 2019 08:14:05 +0200 Subject: [PATCH] Remove redundant field names --- src/host/wasapi/device.rs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/host/wasapi/device.rs b/src/host/wasapi/device.rs index 929c604..d7e162f 100644 --- a/src/host/wasapi/device.rs +++ b/src/host/wasapi/device.rs @@ -336,7 +336,7 @@ unsafe fn format_from_waveformatex_ptr( let format = Format { channels: (*waveformatex_ptr).nChannels as _, sample_rate: SampleRate((*waveformatex_ptr).nSamplesPerSec), - data_type: data_type, + data_type, }; Some(format) } @@ -400,7 +400,7 @@ impl Device { #[inline] fn from_immdevice(device: *mut IMMDevice) -> Self { Device { - device: device, + device, future_audio_client: Arc::new(Mutex::new(None)), } } @@ -763,15 +763,15 @@ impl Device { // `run()` method and added to the `RunContext`. { let client_flow = AudioClientFlow::Capture { - capture_client: capture_client, + capture_client, }; let inner = StreamInner { id: new_stream_id.clone(), - audio_client: audio_client, - client_flow: client_flow, - event: event, + audio_client, + client_flow, + event, playing: false, - max_frames_in_buffer: max_frames_in_buffer, + max_frames_in_buffer, bytes_per_frame: waveformatex.nBlockAlign, sample_format: format.data_type, }; @@ -924,15 +924,15 @@ impl Device { // `run()` method and added to the `RunContext`. { let client_flow = AudioClientFlow::Render { - render_client: render_client, + render_client, }; let inner = StreamInner { id: new_stream_id.clone(), - audio_client: audio_client, - client_flow: client_flow, - event: event, + audio_client, + client_flow, + event, playing: false, - max_frames_in_buffer: max_frames_in_buffer, + max_frames_in_buffer, bytes_per_frame: waveformatex.nBlockAlign, sample_format: format.data_type, }; @@ -1039,7 +1039,7 @@ impl From<*const IMMDevice> for Endpoint { fn from(device: *const IMMDevice) -> Self { unsafe { let endpoint = immendpoint_from_immdevice(device); - Endpoint { endpoint: endpoint } + Endpoint { endpoint } } } } @@ -1118,7 +1118,7 @@ impl Devices { check_result_backend_specific((*collection).GetCount(&mut count))?; Ok(Devices { - collection: collection, + collection, total_count: count, next_item: 0, })