Skip to content

Commit b8af859

Browse files
committed
cleanup: clippy auto-fixes
1 parent f53c393 commit b8af859

File tree

22 files changed

+90
-90
lines changed

22 files changed

+90
-90
lines changed

auth_webview/src/main.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ async fn continue_auth(
2424
println!("Authorization Code: {}", &authorization_code);
2525
let local_code_verifier = PkceCodeVerifier::new(code_verifier.secret().clone());
2626
let wl_token = xal
27-
.exchange_code_for_token(&authorization_code, local_code_verifier)
27+
.exchange_code_for_token(authorization_code, local_code_verifier)
2828
.await
2929
.expect("Failed exchanging code for token");
3030
println!("WL={:?}", wl_token);
@@ -99,9 +99,9 @@ fn main() -> wry::Result<()> {
9999
.with_url(&auth_url)?
100100
.with_devtools(true)
101101
.with_navigation_handler(move |uri: String| {
102-
let submitted = proxy.send_event(UserEvent::Navigation(uri.clone())).is_ok();
102+
103103

104-
submitted
104+
proxy.send_event(UserEvent::Navigation(uri)).is_ok()
105105
})
106106
.build()?;
107107

gamestreaming_native/src/crypto.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ impl MsSrtpCryptoContext {
107107
&mut hmac_key,
108108
)?;
109109

110-
Ok(MsSrtpCryptoContext::get_keyed_hasher(&hmac_key)?)
110+
MsSrtpCryptoContext::get_keyed_hasher(&hmac_key)
111111
}
112112

113113
pub fn decrypt_rtp_with_header(

gamestreaming_native/src/packets/audio.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
#[derive(Debug, Clone, PartialEq)]
1+
#[derive(Debug, Clone, PartialEq, Eq)]
22
pub enum AudioPacketType {
33
ServerHandshake = 1,
44
ClientHandshake = 2,
55
Control = 3,
66
Data = 4,
77
}
88

9-
#[derive(Debug, Clone, PartialEq)]
9+
#[derive(Debug, Clone, PartialEq, Eq)]
1010
pub enum AudioCodec {
1111
Opus = 0,
1212
PCM = 1,
@@ -21,43 +21,43 @@ bitflags! {
2121
}
2222
}
2323

24-
#[derive(Debug, Clone, PartialEq)]
24+
#[derive(Debug, Clone, PartialEq, Eq)]
2525
pub enum AudioDataFlags {}
2626

27-
#[derive(Debug, Clone, PartialEq)]
27+
#[derive(Debug, Clone, PartialEq, Eq)]
2828
pub struct PCMAudioFormat {
2929
pub bits: u32,
3030
pub is_float: u32,
3131
}
3232

33-
#[derive(Debug, Clone, PartialEq)]
33+
#[derive(Debug, Clone, PartialEq, Eq)]
3434
pub struct AudioFormat {
3535
pub channels: u32,
3636
pub frequency: u32,
3737
pub codec: u32,
3838
pub pcm_format: Option<PCMAudioFormat>,
3939
}
4040

41-
#[derive(Debug, Clone, PartialEq)]
41+
#[derive(Debug, Clone, PartialEq, Eq)]
4242
pub struct AudioServerHandshake {
4343
pub protocol_version: u32,
4444
pub reference_timestamp: u64,
4545
pub format_count: u32,
4646
pub formats: Box<[AudioFormat]>,
4747
}
4848

49-
#[derive(Debug, Clone, PartialEq)]
49+
#[derive(Debug, Clone, PartialEq, Eq)]
5050
pub struct AudioClientHandshake {
5151
pub initial_frame_id: u32,
5252
pub requested_format: AudioFormat,
5353
}
5454

55-
#[derive(Debug, Clone, PartialEq)]
55+
#[derive(Debug, Clone, PartialEq, Eq)]
5656
pub struct AudioControl {
5757
pub flags: u32,
5858
}
5959

60-
#[derive(Debug, Clone, PartialEq)]
60+
#[derive(Debug, Clone, PartialEq, Eq)]
6161
pub struct AudioData {
6262
pub flags: u32,
6363
pub frame_id: u32,
@@ -66,7 +66,7 @@ pub struct AudioData {
6666
pub data: Vec<u8>,
6767
}
6868

69-
#[derive(Debug, Clone, PartialEq)]
69+
#[derive(Debug, Clone, PartialEq, Eq)]
7070
pub enum AudioPacket {
7171
ServerHandshake(AudioServerHandshake),
7272
ClientHandshake(AudioClientHandshake),

gamestreaming_native/src/packets/input.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[derive(Debug, Clone, PartialEq)]
1+
#[derive(Debug, Clone, PartialEq, Eq)]
22
pub enum InputPacketType {
33
ServerHandshakeV3 = 1,
44
ClientHandshakeV3 = 2,
@@ -10,7 +10,7 @@ pub enum InputPacketType {
1010
FrameV4 = 7,
1111
}
1212

13-
#[derive(Debug, Clone, PartialEq)]
13+
#[derive(Debug, Clone, PartialEq, Eq)]
1414
pub struct InputServerHandshake {
1515
pub min_protocol_version: u32,
1616
pub max_protocol_version: u32,
@@ -20,27 +20,27 @@ pub struct InputServerHandshake {
2020
pub initial_frame_id: u32,
2121
}
2222

23-
#[derive(Debug, Clone, PartialEq)]
23+
#[derive(Debug, Clone, PartialEq, Eq)]
2424
pub struct InputClientHandshake {
2525
pub min_protocol_version: u32,
2626
pub max_protocol_version: u32,
2727
pub maximum_touches: u32,
2828
pub reference_timestamp: u64,
2929
}
3030

31-
#[derive(Debug, Clone, PartialEq)]
31+
#[derive(Debug, Clone, PartialEq, Eq)]
3232
pub struct InputFrameAck {
3333
pub acked_frame_id: u32,
3434
}
3535

36-
#[derive(Debug, Clone, PartialEq)]
36+
#[derive(Debug, Clone, PartialEq, Eq)]
3737
pub struct InputFrameV3 {
3838
pub frame_id: u32,
3939
pub timestamp: i64,
4040
pub frame: FrameV3Data,
4141
}
4242

43-
#[derive(Debug, Clone, PartialEq)]
43+
#[derive(Debug, Clone, PartialEq, Eq)]
4444
pub struct FrameV3Data {
4545
pub input_count: u32,
4646
pub unknown: Option<Vec<(u32, u32, u32)>>, // length: input_count
@@ -49,26 +49,26 @@ pub struct FrameV3Data {
4949
pub data_keyboard: Option<KeyboardData>,
5050
}
5151

52-
#[derive(Debug, Clone, PartialEq)]
52+
#[derive(Debug, Clone, PartialEq, Eq)]
5353
pub struct MouseData {}
5454

55-
#[derive(Debug, Clone, PartialEq)]
55+
#[derive(Debug, Clone, PartialEq, Eq)]
5656
pub struct GamepadData {}
5757

58-
#[derive(Debug, Clone, PartialEq)]
58+
#[derive(Debug, Clone, PartialEq, Eq)]
5959
pub struct KeyboardData {}
6060

61-
#[derive(Debug, Clone, PartialEq)]
61+
#[derive(Debug, Clone, PartialEq, Eq)]
6262
pub struct InputFrameV4 {
6363
pub frame_id: u32,
6464
pub timestamp: i64,
6565
pub frame_changes: FrameChanges,
6666
}
6767

68-
#[derive(Debug, Clone, PartialEq)]
68+
#[derive(Debug, Clone, PartialEq, Eq)]
6969
pub struct FrameChanges {}
7070

71-
#[derive(Debug, Clone, PartialEq)]
71+
#[derive(Debug, Clone, PartialEq, Eq)]
7272
pub enum InputPacket {
7373
ServerHandshake(InputServerHandshake),
7474
ClientHandshake(InputClientHandshake),
+4-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
#[derive(Debug, Clone, PartialEq)]
1+
#[derive(Debug, Clone, PartialEq, Eq)]
22
pub enum MessagePacketType {
33
Handshake = 1,
44
Data = 2,
55
CancelRequest = 3,
66
}
77

8-
#[derive(Debug, Clone, PartialEq)]
8+
#[derive(Debug, Clone, PartialEq, Eq)]
99
pub struct MessageHandshake {
1010
pub unknown: u32,
1111
}
1212

13-
#[derive(Debug, Clone, PartialEq)]
13+
#[derive(Debug, Clone, PartialEq, Eq)]
1414
pub struct MessageData {
1515
pub unknown1: u32,
1616
pub unknown2: u32,
@@ -20,7 +20,7 @@ pub struct MessageData {
2020
pub unknown6: u32,
2121
}
2222

23-
#[derive(Debug, Clone, PartialEq)]
23+
#[derive(Debug, Clone, PartialEq, Eq)]
2424
pub struct MessageCancelRequest {
2525
pub unknown: u32,
2626
}

gamestreaming_native/src/packets/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use mux_dct_control::MuxDCTControlPacket;
1919
use serializing::Deserialize;
2020
use udp_connection_probing::ConnectionProbingPacket;
2121

22-
#[derive(Debug, Clone, PartialEq)]
22+
#[derive(Debug, Clone, PartialEq, Eq)]
2323
#[repr(u8)]
2424
pub enum PayloadType {
2525
Unknown = 0x0,
@@ -44,7 +44,7 @@ impl From<u8> for PayloadType {
4444
}
4545
}
4646

47-
#[derive(Debug, Clone, PartialEq)]
47+
#[derive(Debug, Clone, PartialEq, Eq)]
4848
#[repr(u8)]
4949
pub enum ControlProtocolMessageOpCode {
5050
Auth = 0x1,

gamestreaming_native/src/packets/mux_dct_channel.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use crate::packets::{audio, input, qos, video};
1111
/// Microsoft::Basix::Dct::Channel::Class::Control
1212
/// Microsoft::Basix::Dct::Channel::Class::Messaging
1313
/// Microsoft::Basix::Dct::Channel::Class::QoS
14-
#[derive(Debug, Clone, PartialEq)]
14+
#[derive(Debug, Clone, PartialEq, Eq)]
1515
pub enum ChannelType {
1616
Base,
1717

gamestreaming_native/src/packets/mux_dct_control.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ RTP: MuxDCTControl Seq: 11, ts: 0, ssrc: 1026
4545
0000000e
4646
*/
4747

48-
#[derive(Debug, Clone, PartialEq)]
48+
#[derive(Debug, Clone, PartialEq, Eq)]
4949
pub enum ControlProtocolPacketType {
5050
Create = 2,
5151
Open = 3,
5252
Close = 4,
5353
}
5454

55-
#[derive(Debug, Clone, PartialEq)]
55+
#[derive(Debug, Clone, PartialEq, Eq)]
5656
pub struct MuxDCTControlHeader {
5757
pub bla: u16,
5858
pub bla2: u16,
@@ -76,7 +76,7 @@ impl Deserialize for MuxDCTControlHeader {
7676
}
7777
}
7878

79-
#[derive(Debug, Clone, PartialEq)]
79+
#[derive(Debug, Clone, PartialEq, Eq)]
8080
pub enum MuxDCTControlPacket {
8181
JustHeader(MuxDCTControlHeader),
8282
}

gamestreaming_native/src/packets/ping.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use sha2::Sha256;
99
type Error = Box<dyn std::error::Error>;
1010
type Result<T> = std::result::Result<T, Error>;
1111

12-
#[derive(Debug, Clone, PartialEq)]
12+
#[derive(Debug, Clone, PartialEq, Eq)]
1313
pub struct PingPayload {
1414
pub ping_type: u8,
1515
pub flags: u8,
@@ -70,7 +70,7 @@ impl Deserialize for PingPayload {
7070
}
7171
}
7272

73-
#[derive(Debug, Clone, PartialEq)]
73+
#[derive(Debug, Clone, PartialEq, Eq)]
7474
pub enum PingPacket {
7575
Request(PingPayload),
7676
Response(PingPayload),
@@ -144,7 +144,7 @@ mod test {
144144
let salt = &hex::decode("ffff").expect("Failed to hex-decode salt");
145145

146146
let mut ping_signing_ctx = ctx
147-
.get_ping_signing_ctx(&salt)
147+
.get_ping_signing_ctx(salt)
148148
.expect("Failed to get ping signing context");
149149

150150
let body = PingPayload::new_request(0, &mut ping_signing_ctx);

gamestreaming_native/src/packets/qos.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[derive(Debug, Clone, PartialEq)]
1+
#[derive(Debug, Clone, PartialEq, Eq)]
22
pub enum QosPacketType {
33
ServerHandshake = 1,
44
ClientHandshake = 2,
@@ -14,7 +14,7 @@ bitflags! {
1414
}
1515
}
1616

17-
#[derive(Debug, Clone, PartialEq)]
17+
#[derive(Debug, Clone, PartialEq, Eq)]
1818
pub struct QosServerPolicy {
1919
pub schema_version: u32,
2020
pub policy_length: u32,
@@ -23,35 +23,35 @@ pub struct QosServerPolicy {
2323
pub fragment_size: u32,
2424
}
2525

26-
#[derive(Debug, Clone, PartialEq)]
26+
#[derive(Debug, Clone, PartialEq, Eq)]
2727
pub struct QosServerHandshake {
2828
pub protocol_version: u32,
2929
pub min_supported_client_version: Option<u32>, // if protocol_version >= 1
3030
}
3131

32-
#[derive(Debug, Clone, PartialEq)]
32+
#[derive(Debug, Clone, PartialEq, Eq)]
3333
pub struct QosClientPolicy {
3434
pub schema_version: u32,
3535
}
3636

37-
#[derive(Debug, Clone, PartialEq)]
37+
#[derive(Debug, Clone, PartialEq, Eq)]
3838
pub struct QosClientHandshake {
3939
pub protocol_version: u32,
4040
pub initial_frame_id: u32,
4141
}
4242

43-
#[derive(Debug, Clone, PartialEq)]
43+
#[derive(Debug, Clone, PartialEq, Eq)]
4444
pub struct QosControl {
4545
pub flags: u32,
4646
}
4747

48-
#[derive(Debug, Clone, PartialEq)]
48+
#[derive(Debug, Clone, PartialEq, Eq)]
4949
pub struct QosData {
5050
pub flags: u32,
5151
pub frame_id: u32,
5252
}
5353

54-
#[derive(Debug, Clone, PartialEq)]
54+
#[derive(Debug, Clone, PartialEq, Eq)]
5555
pub enum QosPacket {
5656
ServerHandshake(QosServerHandshake),
5757
ClientHandshake(QosClientHandshake),

gamestreaming_native/src/packets/udp_connection_probing.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use super::serializing::Deserialize;
88
type Error = Box<dyn std::error::Error>;
99
type Result<T> = std::result::Result<T, Error>;
1010

11-
#[derive(Debug, Clone, PartialEq)]
11+
#[derive(Debug, Clone, PartialEq, Eq)]
1212
pub struct ConnectionProbingSyn {
1313
pub msg_type: ConnectionProbingType,
1414
pub probe_data: Vec<u8>,
@@ -29,7 +29,7 @@ impl Deserialize for ConnectionProbingSyn {
2929
}
3030
}
3131

32-
#[derive(Debug, Clone, PartialEq)]
32+
#[derive(Debug, Clone, PartialEq, Eq)]
3333
pub struct ConnectionProbingAck {
3434
pub msg_type: ConnectionProbingType,
3535
pub accepted_packet_size: u16,
@@ -52,7 +52,7 @@ impl Deserialize for ConnectionProbingAck {
5252
}
5353
}
5454

55-
#[derive(Debug, Clone, PartialEq)]
55+
#[derive(Debug, Clone, PartialEq, Eq)]
5656
#[repr(u16)]
5757
pub enum ConnectionProbingType {
5858
Syn = 1,
@@ -67,7 +67,7 @@ impl From<u16> for ConnectionProbingType {
6767
}
6868
}
6969

70-
#[derive(Debug, Clone, PartialEq)]
70+
#[derive(Debug, Clone, PartialEq, Eq)]
7171
pub enum ConnectionProbingPacket {
7272
Syn(ConnectionProbingSyn),
7373
Ack(ConnectionProbingAck),

0 commit comments

Comments
 (0)