Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
yngrtc committed Dec 5, 2024
1 parent de46a53 commit 7bd5114
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 16 deletions.
2 changes: 1 addition & 1 deletion media/src/io/ogg_writer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ impl<W: Write + Seek> OggWriter<W> {
) -> Result<()> {
self.last_payload_size = payload.len();
self.last_payload = payload.clone();
let n_segments = (self.last_payload_size + 255 - 1) / 255;
let n_segments = self.last_payload_size.div_ceil(255);

let mut page =
Vec::with_capacity(PAGE_HEADER_SIZE + 1 + self.last_payload_size + n_segments);
Expand Down
2 changes: 1 addition & 1 deletion media/src/io/sample_builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ impl<T: Depacketizer> SampleBuilder<T> {
}
}

/// Computes the distance between two sequence numbers
// Computes the distance between two sequence numbers
/*pub(crate) fn seqnum_distance(head: u16, tail: u16) -> u16 {
if head > tail {
head.wrapping_add(tail)
Expand Down
6 changes: 0 additions & 6 deletions rtp/src/codecs/h265/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ impl Payloader for HevcPayloader {
///
/// Network Abstraction Unit Header implementation
///
const H265NALU_HEADER_SIZE: usize = 2;
/// <https://datatracker.ietf.org/doc/html/rfc7798#section-4.4.2>
const H265NALU_AGGREGATION_PACKET_TYPE: u8 = 48;
Expand Down Expand Up @@ -626,10 +625,8 @@ impl H265AggregationPacket {
}
}

///
/// Fragmentation Unit implementation
///
/// H265FragmentationUnitHeader is a H265 FU Header
/// +---------------+
/// |0|1|2|3|4|5|6|7|
Expand Down Expand Up @@ -759,7 +756,6 @@ impl H265FragmentationUnitPacket {
///
/// PACI implementation
///
/// H265PACIPacket represents a single H265 PACI packet.
///
/// 0 1 2 3
Expand Down Expand Up @@ -908,7 +904,6 @@ impl H265PACIPacket {
///
/// Temporal Scalability Control Information
///
/// H265TSCI is a Temporal Scalability Control Information header extension.
///
/// ## Specifications
Expand Down Expand Up @@ -976,7 +971,6 @@ impl Default for H265Payload {
///
/// Packet implementation
///
/// H265Packet represents a H265 packet, stored in the payload of an RTP packet.
#[derive(Default, Debug, Clone, PartialEq, Eq)]
pub struct H265Packet {
Expand Down
1 change: 0 additions & 1 deletion sdp/src/description/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ impl fmt::Display for SessionDescription {
impl SessionDescription {
/// API to match draft-ietf-rtcweb-jsep
/// Move to webrtc or its own package?
/// NewJSEPSessionDescription creates a new SessionDescription with
/// some settings that are required by the JSEP spec.
pub fn new_jsep_session_description(identity: bool) -> Self {
Expand Down
2 changes: 1 addition & 1 deletion srtp/src/cipher/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use crate::error::Result;
///> aeadAuthTagLen=16
///
///See https://tools.ietf.org/html/rfc7714 for the full specifications.
///
/// Cipher represents a implementation of one
/// of the SRTP Specific ciphers.
pub(crate) trait Cipher {
Expand Down
10 changes: 5 additions & 5 deletions util/src/sync/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ impl<T> Mutex<T> {
/// dropped (falls out of scope), the lock will be unlocked.
pub struct MutexGuard<'a, T>(sync::MutexGuard<'a, T>);

impl<'a, T> ops::Deref for MutexGuard<'a, T> {
impl<T> ops::Deref for MutexGuard<'_, T> {
type Target = T;

fn deref(&self) -> &Self::Target {
&self.0
}
}

impl<'a, T> ops::DerefMut for MutexGuard<'a, T> {
impl<T> ops::DerefMut for MutexGuard<'_, T> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
Expand Down Expand Up @@ -72,7 +72,7 @@ impl<T> RwLock<T> {
/// dropped.
pub struct RwLockReadGuard<'a, T>(sync::RwLockReadGuard<'a, T>);

impl<'a, T> ops::Deref for RwLockReadGuard<'a, T> {
impl<T> ops::Deref for RwLockReadGuard<'_, T> {
type Target = T;

fn deref(&self) -> &Self::Target {
Expand All @@ -84,15 +84,15 @@ impl<'a, T> ops::Deref for RwLockReadGuard<'a, T> {
/// dropped.
pub struct RwLockWriteGuard<'a, T>(sync::RwLockWriteGuard<'a, T>);

impl<'a, T> ops::Deref for RwLockWriteGuard<'a, T> {
impl<T> ops::Deref for RwLockWriteGuard<'_, T> {
type Target = T;

fn deref(&self) -> &Self::Target {
&self.0
}
}

impl<'a, T> ops::DerefMut for RwLockWriteGuard<'a, T> {
impl<T> ops::DerefMut for RwLockWriteGuard<'_, T> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
Expand Down
2 changes: 1 addition & 1 deletion webrtc/src/mux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use crate::mux::mux_func::MatchFunc;
use crate::util::Error;

/// mux multiplexes packets on a single socket (RFC7983)
///
/// The maximum amount of data that can be buffered before returning errors.
const MAX_BUFFER_SIZE: usize = 1000 * 1000; // 1MB

Expand Down

0 comments on commit 7bd5114

Please sign in to comment.