diff --git a/Cargo.toml b/Cargo.toml index f3c61c80d..9205ced22 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,6 +21,8 @@ once_cell = "1.17.0" sctp-proto = "0.1.3" combine = "4.6.6" # Sadly no DTLS support in rustls. +# If you want to use a system provided openssl you can set env variable +# OPENSSL_NO_VENDOR=1 to override the feature flag vendored openssl = { version = "0.10.45", features = ["vendored"] } openssl-sys = "0.9.80" # STUN diff --git a/src/lib.rs b/src/lib.rs index 505d8d03f..7cce9aec7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1546,7 +1546,7 @@ impl Rtc { /// let mut rtc = Rtc::new(); /// /// let cid: ChannelId = todo!(); // obtain Mid from Event::ChannelOpen - /// let media = rtc.channel(cid).unwrap(); + /// let channel = rtc.channel(cid).unwrap(); /// // TODO write data channel data. /// ``` pub fn channel(&mut self, id: ChannelId) -> Option> { diff --git a/src/media/register.rs b/src/media/register.rs index 89ac580c2..9d340ee80 100644 --- a/src/media/register.rs +++ b/src/media/register.rs @@ -801,7 +801,7 @@ mod test { assert_eq!(reg.nack_check_from, 111.into()); - for i in 116..(3106) { + for i in 116..3106 { reg.update_seq(i.into()); } assert_eq!(reg.nack_check_from, 3101.into()); diff --git a/src/packet/bwe/arrival_group.rs b/src/packet/bwe/arrival_group.rs index 371860245..580bf18ee 100644 --- a/src/packet/bwe/arrival_group.rs +++ b/src/packet/bwe/arrival_group.rs @@ -242,6 +242,7 @@ mod test { #[test] fn test_arrival_group_all_packets_sent_within_burst_interval_belong() { let now = Instant::now(); + #[allow(clippy::vec_init_then_push)] let packets = { let mut packets = vec![]; @@ -294,6 +295,7 @@ mod test { #[test] fn test_arrival_group_out_order_arrival_ignored() { let now = Instant::now(); + #[allow(clippy::vec_init_then_push)] let packets = { let mut packets = vec![]; @@ -353,6 +355,7 @@ mod test { #[test] fn test_arrival_group_arrival_membership() { let now = Instant::now(); + #[allow(clippy::vec_init_then_push)] let packets = { let mut packets = vec![]; diff --git a/src/packet/pacer.rs b/src/packet/pacer.rs index 3c86e6783..9ea337748 100644 --- a/src/packet/pacer.rs +++ b/src/packet/pacer.rs @@ -1126,8 +1126,10 @@ mod test { } fn make_packet(seq_no: u16, size: usize, kind: MediaKind) -> (RtpHeader, Vec, MediaKind) { - let mut header = RtpHeader::default(); - header.sequence_number = seq_no; + let mut header = RtpHeader { + sequence_number: seq_no, + ..Default::default() + }; let data = vec![0; size]; (header, data, kind) diff --git a/src/rtp/rtcp/twcc.rs b/src/rtp/rtcp/twcc.rs index 755d869c4..ab2e75144 100644 --- a/src/rtp/rtcp/twcc.rs +++ b/src/rtp/rtcp/twcc.rs @@ -563,7 +563,7 @@ impl PacketChunk { break; } - // The stauts is not possible to add in this chunk. This could be + // The status is not possible to add in this chunk. This could be // a large delta in a single, or a mismatching run. if !to_fill.can_append_status(i.status()) { reached_end = false; @@ -1316,6 +1316,7 @@ impl fmt::Debug for Twcc { } } +#[allow(clippy::assign_op_pattern)] #[cfg(test)] mod test { use std::time::Duration; @@ -1784,7 +1785,7 @@ mod test { let now = Instant::now(); let base = now + Duration::from_millis(1337 * 64); - let expeceted = vec![ + let expected = vec![ ( 1.into(), PacketStatus::ReceivedSmallDelta, @@ -1837,7 +1838,7 @@ mod test { let result: Vec<_> = twcc.into_iter(now, 1.into()).collect(); - assert_eq!(result, expeceted); + assert_eq!(result, expected); } #[test] diff --git a/src/util/value_history.rs b/src/util/value_history.rs index 4cae37ead..baa741e39 100644 --- a/src/util/value_history.rs +++ b/src/util/value_history.rs @@ -52,6 +52,7 @@ where } } +#[allow(clippy::unchecked_duration_subtraction)] #[cfg(test)] mod test { use std::time::{Duration, Instant}; @@ -73,7 +74,7 @@ mod test { let sum = h.sum_since(now - Duration::from_millis(1600)); assert_eq!(sum, 44); - h.push(now, 0); // the oldes element will be discarded + h.push(now, 0); // the oldest element will be discarded let sum = h.sum_since(now - Duration::from_millis(1600)); assert_eq!(sum, 22); }