1
0
Fork 0
mirror of https://github.com/sile/hls_m3u8.git synced 2024-12-23 12:30:29 +00:00

remove all occurences of ref

This commit is contained in:
Luro02 2019-09-14 21:42:06 +02:00
parent 51b66d2adf
commit b954ae1134
17 changed files with 126 additions and 126 deletions

View file

@ -124,30 +124,30 @@ pub enum Tag {
impl fmt::Display for Tag {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
Tag::ExtM3u(ref t) => t.fmt(f),
Tag::ExtXVersion(ref t) => t.fmt(f),
Tag::ExtInf(ref t) => t.fmt(f),
Tag::ExtXByteRange(ref t) => t.fmt(f),
Tag::ExtXDiscontinuity(ref t) => t.fmt(f),
Tag::ExtXKey(ref t) => t.fmt(f),
Tag::ExtXMap(ref t) => t.fmt(f),
Tag::ExtXProgramDateTime(ref t) => t.fmt(f),
Tag::ExtXDateRange(ref t) => t.fmt(f),
Tag::ExtXTargetDuration(ref t) => t.fmt(f),
Tag::ExtXMediaSequence(ref t) => t.fmt(f),
Tag::ExtXDiscontinuitySequence(ref t) => t.fmt(f),
Tag::ExtXEndList(ref t) => t.fmt(f),
Tag::ExtXPlaylistType(ref t) => t.fmt(f),
Tag::ExtXIFramesOnly(ref t) => t.fmt(f),
Tag::ExtXMedia(ref t) => t.fmt(f),
Tag::ExtXStreamInf(ref t) => t.fmt(f),
Tag::ExtXIFrameStreamInf(ref t) => t.fmt(f),
Tag::ExtXSessionData(ref t) => t.fmt(f),
Tag::ExtXSessionKey(ref t) => t.fmt(f),
Tag::ExtXIndependentSegments(ref t) => t.fmt(f),
Tag::ExtXStart(ref t) => t.fmt(f),
Tag::Unknown(ref t) => t.fmt(f),
match &self {
Tag::ExtM3u(value) => value.fmt(f),
Tag::ExtXVersion(value) => value.fmt(f),
Tag::ExtInf(value) => value.fmt(f),
Tag::ExtXByteRange(value) => value.fmt(f),
Tag::ExtXDiscontinuity(value) => value.fmt(f),
Tag::ExtXKey(value) => value.fmt(f),
Tag::ExtXMap(value) => value.fmt(f),
Tag::ExtXProgramDateTime(value) => value.fmt(f),
Tag::ExtXDateRange(value) => value.fmt(f),
Tag::ExtXTargetDuration(value) => value.fmt(f),
Tag::ExtXMediaSequence(value) => value.fmt(f),
Tag::ExtXDiscontinuitySequence(value) => value.fmt(f),
Tag::ExtXEndList(value) => value.fmt(f),
Tag::ExtXPlaylistType(value) => value.fmt(f),
Tag::ExtXIFramesOnly(value) => value.fmt(f),
Tag::ExtXMedia(value) => value.fmt(f),
Tag::ExtXStreamInf(value) => value.fmt(f),
Tag::ExtXIFrameStreamInf(value) => value.fmt(f),
Tag::ExtXSessionData(value) => value.fmt(f),
Tag::ExtXSessionKey(value) => value.fmt(f),
Tag::ExtXIndependentSegments(value) => value.fmt(f),
Tag::ExtXStart(value) => value.fmt(f),
Tag::Unknown(value) => value.fmt(f),
}
}
}

View file

@ -276,11 +276,11 @@ impl fmt::Display for MasterPlaylist {
for t in &self.session_key_tags {
writeln!(f, "{}", t)?;
}
if let Some(ref t) = self.independent_segments_tag {
writeln!(f, "{}", t)?;
if let Some(value) = &self.independent_segments_tag {
writeln!(f, "{}", value)?;
}
if let Some(ref t) = self.start_tag {
writeln!(f, "{}", t)?;
if let Some(value) = &self.start_tag {
writeln!(f, "{}", value)?;
}
Ok(())
}

View file

@ -282,29 +282,29 @@ impl fmt::Display for MediaPlaylist {
writeln!(f, "{}", self.version_tag)?;
}
writeln!(f, "{}", self.target_duration_tag)?;
if let Some(ref t) = self.media_sequence_tag {
writeln!(f, "{}", t)?;
if let Some(value) = &self.media_sequence_tag {
writeln!(f, "{}", value)?;
}
if let Some(ref t) = self.discontinuity_sequence_tag {
writeln!(f, "{}", t)?;
if let Some(value) = &self.discontinuity_sequence_tag {
writeln!(f, "{}", value)?;
}
if let Some(ref t) = self.playlist_type_tag {
writeln!(f, "{}", t)?;
if let Some(value) = &self.playlist_type_tag {
writeln!(f, "{}", value)?;
}
if let Some(ref t) = self.i_frames_only_tag {
writeln!(f, "{}", t)?;
if let Some(value) = &self.i_frames_only_tag {
writeln!(f, "{}", value)?;
}
if let Some(ref t) = self.independent_segments_tag {
writeln!(f, "{}", t)?;
if let Some(value) = &self.independent_segments_tag {
writeln!(f, "{}", value)?;
}
if let Some(ref t) = self.start_tag {
writeln!(f, "{}", t)?;
if let Some(value) = &self.start_tag {
writeln!(f, "{}", value)?;
}
for segment in &self.segments {
write!(f, "{}", segment)?;
}
if let Some(ref t) = self.end_list_tag {
writeln!(f, "{}", t)?;
if let Some(value) = &self.end_list_tag {
writeln!(f, "{}", value)?;
}
Ok(())
}

View file

@ -50,23 +50,23 @@ impl MediaSegmentBuilder {
impl fmt::Display for MediaSegment {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
for t in &self.key_tags {
writeln!(f, "{}", t)?;
for value in &self.key_tags {
writeln!(f, "{}", value)?;
}
if let Some(ref t) = self.map_tag {
writeln!(f, "{}", t)?;
if let Some(value) = &self.map_tag {
writeln!(f, "{}", value)?;
}
if let Some(ref t) = self.byte_range_tag {
writeln!(f, "{}", t)?;
if let Some(value) = &self.byte_range_tag {
writeln!(f, "{}", value)?;
}
if let Some(ref t) = self.date_range_tag {
writeln!(f, "{}", t)?;
if let Some(value) = &self.date_range_tag {
writeln!(f, "{}", value)?;
}
if let Some(ref t) = self.discontinuity_tag {
writeln!(f, "{}", t)?;
if let Some(value) = &self.discontinuity_tag {
writeln!(f, "{}", value)?;
}
if let Some(ref t) = self.program_date_time_tag {
writeln!(f, "{}", t)?;
if let Some(value) = &self.program_date_time_tag {
writeln!(f, "{}", value)?;
}
writeln!(f, "{},", self.inf_tag)?;
writeln!(f, "{}", self.uri)?;

View file

@ -61,20 +61,20 @@ impl fmt::Display for ExtXIFrameStreamInf {
write!(f, "URI={}", quote(&self.uri))?;
write!(f, ",BANDWIDTH={}", self.bandwidth)?;
if let Some(ref x) = self.average_bandwidth {
write!(f, ",AVERAGE-BANDWIDTH={}", x)?;
if let Some(value) = &self.average_bandwidth {
write!(f, ",AVERAGE-BANDWIDTH={}", value)?;
}
if let Some(ref x) = self.codecs {
write!(f, ",CODECS={}", quote(x))?;
if let Some(value) = &self.codecs {
write!(f, ",CODECS={}", quote(value))?;
}
if let Some(ref x) = self.resolution {
write!(f, ",RESOLUTION={}", x)?;
if let Some(value) = &self.resolution {
write!(f, ",RESOLUTION={}", value)?;
}
if let Some(ref x) = self.hdcp_level {
write!(f, ",HDCP-LEVEL={}", x)?;
if let Some(value) = &self.hdcp_level {
write!(f, ",HDCP-LEVEL={}", value)?;
}
if let Some(ref x) = self.video {
write!(f, ",VIDEO={}", quote(x))?;
if let Some(value) = &self.video {
write!(f, ",VIDEO={}", quote(value))?;
}
Ok(())
}

View file

@ -291,15 +291,15 @@ impl fmt::Display for ExtXMedia {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", Self::PREFIX)?;
write!(f, "TYPE={}", self.media_type)?;
if let Some(ref x) = self.uri {
write!(f, ",URI={}", quote(x))?;
if let Some(value) = &self.uri {
write!(f, ",URI={}", quote(value))?;
}
write!(f, ",GROUP-ID={}", quote(&self.group_id))?;
if let Some(ref x) = self.language {
write!(f, ",LANGUAGE={}", quote(x))?;
if let Some(value) = &self.language {
write!(f, ",LANGUAGE={}", quote(value))?;
}
if let Some(ref x) = self.assoc_language {
write!(f, ",ASSOC-LANGUAGE={}", quote(x))?;
if let Some(value) = &self.assoc_language {
write!(f, ",ASSOC-LANGUAGE={}", quote(value))?;
}
write!(f, ",NAME={}", quote(&self.name))?;
if self.default {
@ -311,14 +311,14 @@ impl fmt::Display for ExtXMedia {
if self.forced {
write!(f, ",FORCED=YES")?;
}
if let Some(ref x) = self.instream_id {
write!(f, ",INSTREAM-ID={}", quote(x))?;
if let Some(value) = &self.instream_id {
write!(f, ",INSTREAM-ID={}", quote(value))?;
}
if let Some(ref x) = self.characteristics {
write!(f, ",CHARACTERISTICS={}", quote(x))?;
if let Some(value) = &self.characteristics {
write!(f, ",CHARACTERISTICS={}", quote(value))?;
}
if let Some(ref x) = self.channels {
write!(f, ",CHANNELS={}", quote(x))?;
if let Some(value) = &self.channels {
write!(f, ",CHANNELS={}", quote(value))?;
}
Ok(())
}

View file

@ -55,12 +55,12 @@ impl fmt::Display for ExtXSessionData {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", Self::PREFIX)?;
write!(f, "DATA-ID={}", quote(&self.data_id))?;
match self.data {
SessionData::Value(ref x) => write!(f, ",VALUE={}", quote(x))?,
SessionData::Uri(ref x) => write!(f, ",URI={}", quote(x))?,
match &self.data {
SessionData::Value(value) => write!(f, ",VALUE={}", quote(value))?,
SessionData::Uri(value) => write!(f, ",URI={}", quote(value))?,
}
if let Some(ref x) = self.language {
write!(f, ",LANGUAGE={}", quote(x))?;
if let Some(value) = &self.language {
write!(f, ",LANGUAGE={}", quote(value))?;
}
Ok(())
}

View file

@ -112,32 +112,32 @@ impl fmt::Display for ExtXStreamInf {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", Self::PREFIX)?;
write!(f, "BANDWIDTH={}", self.bandwidth)?;
if let Some(ref x) = self.average_bandwidth {
write!(f, ",AVERAGE-BANDWIDTH={}", x)?;
if let Some(value) = &self.average_bandwidth {
write!(f, ",AVERAGE-BANDWIDTH={}", value)?;
}
if let Some(ref x) = self.resolution {
write!(f, ",RESOLUTION={}", x)?;
if let Some(value) = &self.resolution {
write!(f, ",RESOLUTION={}", value)?;
}
if let Some(ref x) = self.codecs {
write!(f, ",CODECS={}", quote(x))?;
if let Some(value) = &self.codecs {
write!(f, ",CODECS={}", quote(value))?;
}
if let Some(ref x) = self.frame_rate {
write!(f, ",FRAME-RATE={:.3}", x.as_f64())?;
if let Some(value) = &self.frame_rate {
write!(f, ",FRAME-RATE={:.3}", value.as_f64())?;
}
if let Some(ref x) = self.hdcp_level {
write!(f, ",HDCP-LEVEL={}", x)?;
if let Some(value) = &self.hdcp_level {
write!(f, ",HDCP-LEVEL={}", value)?;
}
if let Some(ref x) = self.audio {
write!(f, ",AUDIO={}", quote(x))?;
if let Some(value) = &self.audio {
write!(f, ",AUDIO={}", quote(value))?;
}
if let Some(ref x) = self.video {
write!(f, ",VIDEO={}", quote(x))?;
if let Some(value) = &self.video {
write!(f, ",VIDEO={}", quote(value))?;
}
if let Some(ref x) = self.subtitles {
write!(f, ",SUBTITLES={}", quote(x))?;
if let Some(value) = &self.subtitles {
write!(f, ",SUBTITLES={}", quote(value))?;
}
if let Some(ref x) = self.closed_captions {
write!(f, ",CLOSED-CAPTIONS={}", x)?;
if let Some(value) = &self.closed_captions {
write!(f, ",CLOSED-CAPTIONS={}", value)?;
}
write!(f, "\n{}", self.uri)?;
Ok(())

View file

@ -42,12 +42,12 @@ impl fmt::Display for ExtXDateRange {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", Self::PREFIX)?;
write!(f, "ID={}", quote(&self.id))?;
if let Some(ref x) = self.class {
write!(f, ",CLASS={}", quote(x))?;
if let Some(value) = &self.class {
write!(f, ",CLASS={}", quote(value))?;
}
write!(f, ",START-DATE={}", quote(&self.start_date))?;
if let Some(ref x) = self.end_date {
write!(f, ",END-DATE={}", quote(x))?;
if let Some(value) = &self.end_date {
write!(f, ",END-DATE={}", quote(value))?;
}
if let Some(x) = self.duration {
write!(f, ",DURATION={}", DecimalFloatingPoint::from_duration(x))?;
@ -59,14 +59,14 @@ impl fmt::Display for ExtXDateRange {
DecimalFloatingPoint::from_duration(x)
)?;
}
if let Some(ref x) = self.scte35_cmd {
write!(f, ",SCTE35-CMD={}", quote(x))?;
if let Some(value) = &self.scte35_cmd {
write!(f, ",SCTE35-CMD={}", quote(value))?;
}
if let Some(ref x) = self.scte35_out {
write!(f, ",SCTE35-OUT={}", quote(x))?;
if let Some(value) = &self.scte35_out {
write!(f, ",SCTE35-OUT={}", quote(value))?;
}
if let Some(ref x) = self.scte35_in {
write!(f, ",SCTE35-IN={}", quote(x))?;
if let Some(value) = &self.scte35_in {
write!(f, ",SCTE35-IN={}", quote(value))?;
}
if self.end_on_next {
write!(f, ",END-ON-NEXT=YES",)?;

View file

@ -62,8 +62,8 @@ impl fmt::Display for ExtInf {
+ (f64::from(self.duration.subsec_nanos()) / 1_000_000_000.0);
write!(f, "{}", duration)?;
if let Some(ref title) = self.title {
write!(f, ",{}", title)?;
if let Some(value) = &self.title {
write!(f, ",{}", value)?;
}
Ok(())
}

View file

@ -43,8 +43,8 @@ impl ExtXKey {
impl fmt::Display for ExtXKey {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", Self::PREFIX)?;
if let Some(ref key) = self.0 {
write!(f, "{}", key)?;
if let Some(value) = &self.0 {
write!(f, "{}", value)?;
} else {
write!(f, "METHOD=NONE")?;
}

View file

@ -54,8 +54,8 @@ impl fmt::Display for ExtXMap {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", Self::PREFIX)?;
write!(f, "URI={}", quote(&self.uri))?;
if let Some(ref x) = self.range {
write!(f, ",BYTERANGE={}", quote(x))?;
if let Some(value) = &self.range {
write!(f, ",BYTERANGE={}", quote(value))?;
}
Ok(())
}

View file

@ -17,8 +17,8 @@ pub enum ClosedCaptions {
impl fmt::Display for ClosedCaptions {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ClosedCaptions::GroupId(ref x) => write!(f, "{}", quote(x)),
match &self {
ClosedCaptions::GroupId(value) => write!(f, "{}", quote(value)),
ClosedCaptions::None => "NONE".fmt(f),
}
}

View file

@ -37,14 +37,14 @@ impl fmt::Display for DecryptionKey {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "METHOD={}", self.method)?;
write!(f, ",URI={}", quote(&self.uri))?;
if let Some(ref x) = self.iv {
write!(f, ",IV={}", x)?;
if let Some(value) = &self.iv {
write!(f, ",IV={}", value)?;
}
if let Some(ref x) = self.key_format {
write!(f, ",KEYFORMAT={}", quote(x))?;
if let Some(value) = &self.key_format {
write!(f, ",KEYFORMAT={}", quote(value))?;
}
if let Some(ref x) = self.key_format_versions {
write!(f, ",KEYFORMATVERSIONS={}", quote(x))?;
if let Some(value) = &self.key_format_versions {
write!(f, ",KEYFORMATVERSIONS={}", quote(value))?;
}
Ok(())
}

View file

@ -17,7 +17,7 @@ pub enum EncryptionMethod {
impl fmt::Display for EncryptionMethod {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
match &self {
EncryptionMethod::Aes128 => "AES-128".fmt(f),
EncryptionMethod::SampleAes => "SAMPLE-AES".fmt(f),
}

View file

@ -17,7 +17,7 @@ pub enum HdcpLevel {
impl fmt::Display for HdcpLevel {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
match &self {
HdcpLevel::Type0 => "TYPE-0".fmt(f),
HdcpLevel::None => "NONE".fmt(f),
}

View file

@ -19,7 +19,7 @@ pub enum MediaType {
impl fmt::Display for MediaType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
match &self {
MediaType::Audio => "AUDIO".fmt(f),
MediaType::Video => "VIDEO".fmt(f),
MediaType::Subtitles => "SUBTITLES".fmt(f),