From e8d498a5383094bed3f2a72cc960773d81c8365e Mon Sep 17 00:00:00 2001 From: Andrey Date: Thu, 28 Mar 2024 18:34:39 +0500 Subject: [PATCH] Fixed code by Clippy lints --- interceptor/src/twcc/twcc_test.rs | 4 ++-- webrtc/src/rtp_transceiver/mod.rs | 2 +- webrtc/src/rtp_transceiver/rtp_receiver/mod.rs | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/interceptor/src/twcc/twcc_test.rs b/interceptor/src/twcc/twcc_test.rs index 93652c607..2bef1ffda 100644 --- a/interceptor/src/twcc/twcc_test.rs +++ b/interceptor/src/twcc/twcc_test.rs @@ -259,7 +259,7 @@ fn test_feedback() -> Result<()> { pkt.packet_chunks ); - let expected_deltas = vec![ + let expected_deltas = [ RecvDelta { type_tcc_packet: SymbolTypeTcc::PacketReceivedSmallDelta, delta: 0, @@ -338,7 +338,7 @@ fn test_feedback() -> Result<()> { pkt.packet_chunks ); - let expected_deltas = vec![ + let expected_deltas = [ RecvDelta { type_tcc_packet: SymbolTypeTcc::PacketReceivedSmallDelta, delta: 0, diff --git a/webrtc/src/rtp_transceiver/mod.rs b/webrtc/src/rtp_transceiver/mod.rs index 1edb5fc99..19bcdf52e 100644 --- a/webrtc/src/rtp_transceiver/mod.rs +++ b/webrtc/src/rtp_transceiver/mod.rs @@ -301,7 +301,7 @@ impl RTCRtpTransceiver { /// mid gets the Transceiver's mid value. When not already set, this value will be set in CreateOffer or create_answer. pub fn mid(&self) -> Option { - self.mid.get().map(Clone::clone) + self.mid.get().cloned() } /// kind returns RTPTransceiver's kind. diff --git a/webrtc/src/rtp_transceiver/rtp_receiver/mod.rs b/webrtc/src/rtp_transceiver/rtp_receiver/mod.rs index 6d1983923..8a2f40f24 100644 --- a/webrtc/src/rtp_transceiver/rtp_receiver/mod.rs +++ b/webrtc/src/rtp_transceiver/rtp_receiver/mod.rs @@ -493,6 +493,8 @@ impl RTCRtpReceiver { if tracks.len() != 1 { None } else { + // Clippy bug (reported at https://github.com/rust-lang/rust-clippy/issues/12560) suggests .first().cloned() + #[allow(clippy::map_clone)] tracks.first().map(|t| Arc::clone(&t.track)) } }