Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Channel<'_>> {
Expand Down
2 changes: 1 addition & 1 deletion src/media/register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
3 changes: 3 additions & 0 deletions src/packet/bwe/arrival_group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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![];

Expand Down Expand Up @@ -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![];

Expand Down Expand Up @@ -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![];

Expand Down
6 changes: 4 additions & 2 deletions src/packet/pacer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1126,8 +1126,10 @@ mod test {
}

fn make_packet(seq_no: u16, size: usize, kind: MediaKind) -> (RtpHeader, Vec<u8>, 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)
Expand Down
7 changes: 4 additions & 3 deletions src/rtp/rtcp/twcc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -1316,6 +1316,7 @@ impl fmt::Debug for Twcc {
}
}

#[allow(clippy::assign_op_pattern)]
#[cfg(test)]
mod test {
use std::time::Duration;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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]
Expand Down
3 changes: 2 additions & 1 deletion src/util/value_history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ where
}
}

#[allow(clippy::unchecked_duration_subtraction)]
#[cfg(test)]
mod test {
use std::time::{Duration, Instant};
Expand All @@ -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);
}
Expand Down