Skip to content

Commit

Permalink
fix: clippy check
Browse files Browse the repository at this point in the history
  • Loading branch information
hongcha98 committed Nov 2, 2023
1 parent b268c04 commit 974b96b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/forward/rtcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ pub(crate) enum RtcpMessage {

impl RtcpMessage {
pub(crate) fn from_rtcp_packet(packet: Box<dyn Packet + Send + Sync>) -> Option<Self> {
let x = packet.as_any();
if let Some(_) = x.downcast_ref::<FullIntraRequest>() {
let any = packet.as_any();
if any.downcast_ref::<FullIntraRequest>().is_some() {
return Some(RtcpMessage::FullIntraRequest);
} else if let Some(_) = x.downcast_ref::<PictureLossIndication>() {
} else if any.downcast_ref::<PictureLossIndication>().is_some() {
return Some(RtcpMessage::PictureLossIndication);
} else if let Some(_) = x.downcast_ref::<SliceLossIndication>() {
} else if any.downcast_ref::<SliceLossIndication>().is_some() {
return Some(RtcpMessage::SliceLossIndication);
}
None
}

pub(crate) fn to_rtcp_packet(&self, ssrc: u32) -> Box<dyn Packet + Send + Sync> {
pub(crate) fn to_rtcp_packet(self, ssrc: u32) -> Box<dyn Packet + Send + Sync> {
match self {
RtcpMessage::FullIntraRequest => Box::new(FullIntraRequest {
sender_ssrc: 0,
Expand Down

0 comments on commit 974b96b

Please sign in to comment.