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

update dependencies

This commit is contained in:
Luro02 2020-02-02 15:23:47 +01:00
parent e6a1103d24
commit 2471737455
No known key found for this signature in database
GPG key ID: B66FD4F74501A9CF
11 changed files with 38 additions and 116 deletions

View file

@ -17,13 +17,13 @@ codecov = { repository = "sile/hls_m3u8" }
[dependencies]
thiserror = "1.0"
derive_builder = "0.8.0"
chrono = "0.4.9"
strum = { version = "0.16.0", features = ["derive"] }
derive_more = "0.15.0"
hex = "0.4.0"
derive_builder = "0.9"
chrono = "0.4"
strum = { version = "0.17", features = ["derive"] }
derive_more = "0.99"
hex = "0.4"
shorthand = "0.1"
[dev-dependencies]
clap = "2.33.0"
pretty_assertions = "0.6.1"
clap = "2.33"
pretty_assertions = "0.6"

View file

@ -1,7 +1,8 @@
use std::fmt;
use std::ops::{Deref, DerefMut};
use std::str::FromStr;
use derive_more::{Deref, DerefMut};
use crate::attribute::AttributePairs;
use crate::types::{HdcpLevel, ProtocolVersion, StreamInf, StreamInfBuilder};
use crate::utils::{quote, tag, unquote};
@ -18,9 +19,11 @@ use crate::{Error, RequiredVersion};
/// [`Master Playlist`]: crate::MasterPlaylist
/// [`Media Playlist`]: crate::MediaPlaylist
/// [4.3.5.3. EXT-X-I-FRAME-STREAM-INF]: https://tools.ietf.org/html/rfc8216#section-4.3.4.5
#[derive(PartialOrd, Debug, Clone, PartialEq, Eq, Hash)]
#[derive(Deref, DerefMut, PartialOrd, Debug, Clone, PartialEq, Eq, Hash)]
pub struct ExtXIFrameStreamInf {
uri: String,
#[deref]
#[deref_mut]
stream_inf: StreamInf,
}
@ -180,16 +183,6 @@ impl FromStr for ExtXIFrameStreamInf {
}
}
impl Deref for ExtXIFrameStreamInf {
type Target = StreamInf;
fn deref(&self) -> &Self::Target { &self.stream_inf }
}
impl DerefMut for ExtXIFrameStreamInf {
fn deref_mut(&mut self) -> &mut Self::Target { &mut self.stream_inf }
}
#[cfg(test)]
mod test {
use super::*;

View file

@ -1,7 +1,8 @@
use std::fmt;
use std::ops::{Deref, DerefMut};
use std::str::FromStr;
use derive_more::{Deref, DerefMut};
use crate::types::{DecryptionKey, EncryptionMethod, ProtocolVersion};
use crate::utils::tag;
use crate::{Error, RequiredVersion};
@ -16,7 +17,7 @@ use crate::{Error, RequiredVersion};
/// [`Media Playlist`]: crate::MediaPlaylist
/// [`Master Playlist`]: crate::MasterPlaylist
/// [4.3.4.5. EXT-X-SESSION-KEY]: https://tools.ietf.org/html/rfc8216#section-4.3.4.5
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
#[derive(Deref, DerefMut, Debug, Clone, PartialEq, Eq, Hash)]
pub struct ExtXSessionKey(DecryptionKey);
impl ExtXSessionKey {
@ -74,16 +75,6 @@ impl FromStr for ExtXSessionKey {
}
}
impl Deref for ExtXSessionKey {
type Target = DecryptionKey;
fn deref(&self) -> &Self::Target { &self.0 }
}
impl DerefMut for ExtXSessionKey {
fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 }
}
#[cfg(test)]
mod test {
use super::*;

View file

@ -1,7 +1,7 @@
use std::fmt;
use std::ops::{Deref, DerefMut};
use std::str::FromStr;
use derive_more::{Deref, DerefMut};
use shorthand::ShortHand;
use crate::attribute::AttributePairs;
@ -23,7 +23,7 @@ use crate::{Error, RequiredVersion};
/// Renditions SHOULD play this Rendition.
///
/// [4.3.4.2. EXT-X-STREAM-INF]: https://tools.ietf.org/html/rfc8216#section-4.3.4.2
#[derive(ShortHand, PartialOrd, Debug, Clone, PartialEq)]
#[derive(Deref, DerefMut, ShortHand, PartialOrd, Debug, Clone, PartialEq)]
#[shorthand(enable(must_use, into))]
pub struct ExtXStreamInf {
/// The `URI` that identifies the associated media playlist.
@ -37,6 +37,8 @@ pub struct ExtXStreamInf {
/// The value of the [`ClosedCaptions`] attribute.
closed_captions: Option<ClosedCaptions>,
#[shorthand(enable(skip))]
#[deref]
#[deref_mut]
stream_inf: StreamInf,
}
@ -249,16 +251,6 @@ impl FromStr for ExtXStreamInf {
}
}
impl Deref for ExtXStreamInf {
type Target = StreamInf;
fn deref(&self) -> &Self::Target { &self.stream_inf }
}
impl DerefMut for ExtXStreamInf {
fn deref_mut(&mut self) -> &mut Self::Target { &mut self.stream_inf }
}
#[cfg(test)]
mod test {
use super::*;

View file

@ -1,8 +1,9 @@
use std::fmt;
use std::ops::Deref;
use std::str::FromStr;
use std::time::Duration;
use derive_more::Deref;
use crate::types::ProtocolVersion;
use crate::utils::tag;
use crate::{Error, RequiredVersion};
@ -15,7 +16,7 @@ use crate::{Error, RequiredVersion};
/// [`MediaSegment`]: crate::MediaSegment
/// [4.3.3.1. EXT-X-TARGETDURATION]:
/// https://tools.ietf.org/html/rfc8216#section-4.3.3.1
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default, PartialOrd, Ord)]
#[derive(Deref, Debug, Clone, Copy, PartialEq, Eq, Hash, Default, PartialOrd, Ord)]
pub struct ExtXTargetDuration(Duration);
impl ExtXTargetDuration {
@ -57,12 +58,6 @@ impl RequiredVersion for ExtXTargetDuration {
fn required_version(&self) -> ProtocolVersion { ProtocolVersion::V1 }
}
impl Deref for ExtXTargetDuration {
type Target = Duration;
fn deref(&self) -> &Self::Target { &self.0 }
}
impl fmt::Display for ExtXTargetDuration {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}{}", Self::PREFIX, self.0.as_secs())

View file

@ -1,7 +1,8 @@
use std::fmt;
use std::ops::{Deref, DerefMut};
use std::str::FromStr;
use derive_more::{Deref, DerefMut};
use crate::types::{ByteRange, ProtocolVersion};
use crate::utils::tag;
use crate::{Error, RequiredVersion};
@ -14,7 +15,7 @@ use crate::{Error, RequiredVersion};
/// [`Media Segment`]: crate::MediaSegment
/// [4.4.2.2. EXT-X-BYTERANGE]:
/// https://tools.ietf.org/html/draft-pantos-hls-rfc8216bis-04#section-4.4.2.2
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[derive(Deref, DerefMut, Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct ExtXByteRange(ByteRange);
impl ExtXByteRange {
@ -51,16 +52,6 @@ impl RequiredVersion for ExtXByteRange {
fn required_version(&self) -> ProtocolVersion { ProtocolVersion::V4 }
}
impl Deref for ExtXByteRange {
type Target = ByteRange;
fn deref(&self) -> &Self::Target { &self.0 }
}
impl DerefMut for ExtXByteRange {
fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 }
}
impl fmt::Display for ExtXByteRange {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", Self::PREFIX)?;

View file

@ -1,7 +1,8 @@
use std::fmt;
use std::ops::{Deref, DerefMut};
use std::str::FromStr;
use derive_more::{Deref, DerefMut};
use crate::types::{DecryptionKey, EncryptionMethod, ProtocolVersion};
use crate::utils::tag;
use crate::{Error, RequiredVersion};
@ -23,7 +24,7 @@ use crate::{Error, RequiredVersion};
/// [`ExtXMap`]: crate::tags::ExtXMap
/// [`Media Segment`]: crate::MediaSegment
/// [4.3.2.4. EXT-X-KEY]: https://tools.ietf.org/html/rfc8216#section-4.3.2.4
#[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[derive(Deref, DerefMut, Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct ExtXKey(DecryptionKey);
impl ExtXKey {
@ -105,16 +106,6 @@ impl fmt::Display for ExtXKey {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}{}", Self::PREFIX, self.0) }
}
impl Deref for ExtXKey {
type Target = DecryptionKey;
fn deref(&self) -> &Self::Target { &self.0 }
}
impl DerefMut for ExtXKey {
fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 }
}
#[cfg(test)]
mod test {
use super::*;

View file

@ -1,8 +1,8 @@
use std::fmt;
use std::ops::{Deref, DerefMut};
use std::str::FromStr;
use chrono::{DateTime, FixedOffset, SecondsFormat};
use derive_more::{Deref, DerefMut};
use crate::types::ProtocolVersion;
use crate::utils::tag;
@ -16,7 +16,7 @@ use crate::{Error, RequiredVersion};
/// [`Media Segment`]: crate::MediaSegment
/// [4.3.2.6. EXT-X-PROGRAM-DATE-TIME]:
/// https://tools.ietf.org/html/rfc8216#section-4.3.2.6
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[derive(Deref, DerefMut, Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct ExtXProgramDateTime(DateTime<FixedOffset>);
impl ExtXProgramDateTime {
@ -124,20 +124,11 @@ impl FromStr for ExtXProgramDateTime {
}
}
impl Deref for ExtXProgramDateTime {
type Target = DateTime<FixedOffset>;
fn deref(&self) -> &Self::Target { &self.0 }
}
impl DerefMut for ExtXProgramDateTime {
fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 }
}
#[cfg(test)]
mod test {
use super::*;
use chrono::{Datelike, TimeZone};
use core::ops::DerefMut;
use pretty_assertions::assert_eq;
const HOURS_IN_SECS: i32 = 3600; // 1 hour = 3600 seconds

View file

@ -1,7 +1,6 @@
use core::ops::Deref;
use core::str::FromStr;
use derive_more::Display;
use derive_more::{Deref, Display};
use crate::Error;
@ -11,7 +10,7 @@ use crate::Error;
///
/// [4.2. Attribute Lists]:
/// https://tools.ietf.org/html/draft-pantos-hls-rfc8216bis-05#section-4.2
#[derive(Default, Debug, Clone, Copy, PartialEq, PartialOrd, Display)]
#[derive(Deref, Default, Debug, Clone, Copy, PartialEq, PartialOrd, Display)]
pub(crate) struct DecimalFloatingPoint(f64);
impl DecimalFloatingPoint {
@ -45,12 +44,6 @@ impl FromStr for DecimalFloatingPoint {
}
}
impl Deref for DecimalFloatingPoint {
type Target = f64;
fn deref(&self) -> &Self::Target { &self.0 }
}
#[doc(hidden)]
impl From<f64> for DecimalFloatingPoint {
fn from(value: f64) -> Self {

View file

@ -1,8 +1,9 @@
use std::convert::Infallible;
use std::fmt;
use std::ops::{Deref, DerefMut};
use std::str::FromStr;
use derive_more::{Deref, DerefMut};
use crate::types::ProtocolVersion;
use crate::utils::{quote, unquote};
use crate::RequiredVersion;
@ -12,7 +13,7 @@ use crate::RequiredVersion;
/// [`KeyFormat`] is defined.
///
/// [`KeyFormat`]: crate::types::KeyFormat
#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
#[derive(Deref, DerefMut, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub struct KeyFormatVersions(Vec<usize>);
impl KeyFormatVersions {
@ -37,16 +38,6 @@ impl Default for KeyFormatVersions {
fn default() -> Self { Self(vec![1]) }
}
impl Deref for KeyFormatVersions {
type Target = Vec<usize>;
fn deref(&self) -> &Self::Target { &self.0 }
}
impl DerefMut for KeyFormatVersions {
fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 }
}
/// This tag requires [`ProtocolVersion::V5`].
impl RequiredVersion for KeyFormatVersions {
fn required_version(&self) -> ProtocolVersion { ProtocolVersion::V5 }

View file

@ -1,4 +1,4 @@
use core::ops::Deref;
use derive_more::Deref;
use derive_more::{Display, FromStr};
/// Signed decimal floating-point number.
@ -6,7 +6,7 @@ use derive_more::{Display, FromStr};
/// See: [4.2. Attribute Lists]
///
/// [4.2. Attribute Lists]: https://tools.ietf.org/html/rfc8216#section-4.2
#[derive(Default, Debug, Clone, Copy, PartialEq, PartialOrd, Display, FromStr)]
#[derive(Deref, Default, Debug, Clone, Copy, PartialEq, PartialOrd, Display, FromStr)]
pub(crate) struct SignedDecimalFloatingPoint(f64);
impl SignedDecimalFloatingPoint {
@ -28,12 +28,6 @@ impl SignedDecimalFloatingPoint {
pub const fn as_f64(self) -> f64 { self.0 }
}
impl Deref for SignedDecimalFloatingPoint {
type Target = f64;
fn deref(&self) -> &Self::Target { &self.0 }
}
#[cfg(test)]
mod tests {
use super::*;