remove fmt_option

This commit is contained in:
Yegor Bayev 2022-01-12 10:50:53 +03:00
parent 101a842dec
commit b47ab977c4
2 changed files with 2 additions and 16 deletions

View File

@ -25,7 +25,6 @@ use url::Url;
use crate::client::parse::SessionHeader;
use crate::codec::CodecItem;
use crate::fmt_option;
use crate::{Error, ErrorInt, RtspMessageContext};
mod channel_mapping;
@ -597,14 +596,11 @@ impl std::fmt::Debug for Stream {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
f.debug_struct("Stream")
.field("media", &self.media)
.field(
"control",
&fmt_option(&self.control.as_ref().map(Url::as_str)),
)
.field("control", &self.control.as_ref().map(Url::as_str))
.field("encoding_name", &self.encoding_name)
.field("rtp_payload_type", &self.rtp_payload_type)
.field("clock_rate", &self.clock_rate)
.field("channels", &fmt_option(&self.channels))
.field("channels", &self.channels)
.field("depacketizer", &self.depacketizer)
.field("UDP", &self.sockets)
.field("state", &self.state)

View File

@ -62,16 +62,6 @@ struct ReceivedMessage {
msg: Message<Bytes>,
}
pub fn fmt_option<T>(opt: &Option<T>) -> String
where
T: std::fmt::Display,
{
match opt {
Some(x) => x.to_string(),
None => "None".to_string(),
}
}
/// A monotonically increasing timestamp within an RTP stream.
///
/// The [Display] and [Debug] implementations display: