mirror of
https://github.com/sile/hls_m3u8.git
synced 2025-01-08 19:25:24 +00:00
commit
fc067c3293
4 changed files with 14 additions and 4 deletions
|
@ -727,7 +727,7 @@ impl FromStr for MediaPlaylist<'static> {
|
||||||
type Err = Error;
|
type Err = Error;
|
||||||
|
|
||||||
fn from_str(input: &str) -> Result<Self, Self::Err> {
|
fn from_str(input: &str) -> Result<Self, Self::Err> {
|
||||||
Ok(parse_media_playlist(input, &mut Self::builder())?.into_owned())
|
Ok(parse_media_playlist(input, &mut MediaPlaylist::builder())?.into_owned())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ use crate::Error;
|
||||||
/// [`NaN`]: core::f32::NAN
|
/// [`NaN`]: core::f32::NAN
|
||||||
/// [`INFINITY`]: core::f32::INFINITY
|
/// [`INFINITY`]: core::f32::INFINITY
|
||||||
/// [`NEG_INFINITY`]: core::f32::NEG_INFINITY
|
/// [`NEG_INFINITY`]: core::f32::NEG_INFINITY
|
||||||
#[derive(AsRef, Deref, Default, Debug, Copy, Clone, Display, PartialOrd)]
|
#[derive(AsRef, Deref, Default, Debug, Copy, Clone, Display)]
|
||||||
pub struct Float(f32);
|
pub struct Float(f32);
|
||||||
|
|
||||||
impl Float {
|
impl Float {
|
||||||
|
@ -129,6 +129,11 @@ impl PartialEq<f32> for Float {
|
||||||
// be soundly implemented.
|
// be soundly implemented.
|
||||||
impl Eq for Float {}
|
impl Eq for Float {}
|
||||||
|
|
||||||
|
impl PartialOrd for Float {
|
||||||
|
#[inline]
|
||||||
|
fn partial_cmp(&self, other: &Self) -> Option<Ordering> { Some(self.cmp(other)) }
|
||||||
|
}
|
||||||
|
|
||||||
impl Ord for Float {
|
impl Ord for Float {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn cmp(&self, other: &Self) -> Ordering {
|
fn cmp(&self, other: &Self) -> Ordering {
|
||||||
|
|
|
@ -19,8 +19,8 @@ use crate::types::ProtocolVersion;
|
||||||
/// [`MediaPlaylist`]: crate::MediaPlaylist
|
/// [`MediaPlaylist`]: crate::MediaPlaylist
|
||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
#[strum(serialize_all = "UPPERCASE")]
|
|
||||||
#[derive(Ord, PartialOrd, Debug, Clone, Copy, PartialEq, Eq, Hash, Display, EnumString)]
|
#[derive(Ord, PartialOrd, Debug, Clone, Copy, PartialEq, Eq, Hash, Display, EnumString)]
|
||||||
|
#[strum(serialize_all = "UPPERCASE")]
|
||||||
pub enum InStreamId {
|
pub enum InStreamId {
|
||||||
Cc1,
|
Cc1,
|
||||||
Cc2,
|
Cc2,
|
||||||
|
|
|
@ -13,7 +13,7 @@ use crate::Error;
|
||||||
/// [`NaN`]: core::f32::NAN
|
/// [`NaN`]: core::f32::NAN
|
||||||
/// [`INFINITY`]: core::f32::INFINITY
|
/// [`INFINITY`]: core::f32::INFINITY
|
||||||
/// [`NEG_INFINITY`]: core::f32::NEG_INFINITY
|
/// [`NEG_INFINITY`]: core::f32::NEG_INFINITY
|
||||||
#[derive(AsRef, Deref, Default, Debug, Copy, Clone, PartialOrd, Display)]
|
#[derive(AsRef, Deref, Default, Debug, Copy, Clone, Display)]
|
||||||
pub struct UFloat(f32);
|
pub struct UFloat(f32);
|
||||||
|
|
||||||
impl UFloat {
|
impl UFloat {
|
||||||
|
@ -141,6 +141,11 @@ impl PartialEq<f32> for UFloat {
|
||||||
// be soundly implemented.
|
// be soundly implemented.
|
||||||
impl Eq for UFloat {}
|
impl Eq for UFloat {}
|
||||||
|
|
||||||
|
impl PartialOrd for UFloat {
|
||||||
|
#[inline]
|
||||||
|
fn partial_cmp(&self, other: &Self) -> Option<Ordering> { Some(self.cmp(other)) }
|
||||||
|
}
|
||||||
|
|
||||||
impl Ord for UFloat {
|
impl Ord for UFloat {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn cmp(&self, other: &Self) -> Ordering {
|
fn cmp(&self, other: &Self) -> Ordering {
|
||||||
|
|
Loading…
Reference in a new issue