1
0
Fork 0
mirror of https://github.com/sile/hls_m3u8.git synced 2024-11-29 02:00:59 +00:00

Apply clippy-0.0.212

This commit is contained in:
Takeru Ohta 2018-10-04 22:10:53 +09:00
parent 8585016720
commit 24a6ff9851
6 changed files with 17 additions and 18 deletions

View file

@ -1,9 +1,8 @@
use trackable::error::{ErrorKind as TrackableErrorKind, TrackableError}; use trackable::error::{ErrorKind as TrackableErrorKind, TrackableError};
/// This crate specific `Error` type. /// This crate specific `Error` type.
#[derive(Debug, Clone)] #[derive(Debug, Clone, TrackableError)]
pub struct Error(TrackableError<ErrorKind>); pub struct Error(TrackableError<ErrorKind>);
derive_traits_for_trackable_error_newtype!(Error, ErrorKind);
/// Possible error kinds. /// Possible error kinds.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]

View file

@ -13,7 +13,7 @@ impl ExtM3u {
pub(crate) const PREFIX: &'static str = "#EXTM3U"; pub(crate) const PREFIX: &'static str = "#EXTM3U";
/// Returns the protocol compatibility version that this tag requires. /// Returns the protocol compatibility version that this tag requires.
pub fn requires_version(&self) -> ProtocolVersion { pub fn requires_version(self) -> ProtocolVersion {
ProtocolVersion::V1 ProtocolVersion::V1
} }
} }
@ -46,12 +46,12 @@ impl ExtXVersion {
} }
/// Returns the protocol compatibility version of the playlist containing this tag. /// Returns the protocol compatibility version of the playlist containing this tag.
pub fn version(&self) -> ProtocolVersion { pub fn version(self) -> ProtocolVersion {
self.version self.version
} }
/// Returns the protocol compatibility version that this tag requires. /// Returns the protocol compatibility version that this tag requires.
pub fn requires_version(&self) -> ProtocolVersion { pub fn requires_version(self) -> ProtocolVersion {
ProtocolVersion::V1 ProtocolVersion::V1
} }
} }

View file

@ -15,7 +15,7 @@ impl ExtXIndependentSegments {
pub(crate) const PREFIX: &'static str = "#EXT-X-INDEPENDENT-SEGMENTS"; pub(crate) const PREFIX: &'static str = "#EXT-X-INDEPENDENT-SEGMENTS";
/// Returns the protocol compatibility version that this tag requires. /// Returns the protocol compatibility version that this tag requires.
pub fn requires_version(&self) -> ProtocolVersion { pub fn requires_version(self) -> ProtocolVersion {
ProtocolVersion::V1 ProtocolVersion::V1
} }
} }

View file

@ -66,12 +66,12 @@ impl ExtXMediaSequence {
} }
/// Returns the sequence number of the first media segment that appears in the associated playlist. /// Returns the sequence number of the first media segment that appears in the associated playlist.
pub fn seq_num(&self) -> u64 { pub fn seq_num(self) -> u64 {
self.seq_num self.seq_num
} }
/// Returns the protocol compatibility version that this tag requires. /// Returns the protocol compatibility version that this tag requires.
pub fn requires_version(&self) -> ProtocolVersion { pub fn requires_version(self) -> ProtocolVersion {
ProtocolVersion::V1 ProtocolVersion::V1
} }
} }
@ -106,12 +106,12 @@ impl ExtXDiscontinuitySequence {
/// Returns the discontinuity sequence number of /// Returns the discontinuity sequence number of
/// the first media segment that appears in the associated playlist. /// the first media segment that appears in the associated playlist.
pub fn seq_num(&self) -> u64 { pub fn seq_num(self) -> u64 {
self.seq_num self.seq_num
} }
/// Returns the protocol compatibility version that this tag requires. /// Returns the protocol compatibility version that this tag requires.
pub fn requires_version(&self) -> ProtocolVersion { pub fn requires_version(self) -> ProtocolVersion {
ProtocolVersion::V1 ProtocolVersion::V1
} }
} }
@ -138,7 +138,7 @@ impl ExtXEndList {
pub(crate) const PREFIX: &'static str = "#EXT-X-ENDLIST"; pub(crate) const PREFIX: &'static str = "#EXT-X-ENDLIST";
/// Returns the protocol compatibility version that this tag requires. /// Returns the protocol compatibility version that this tag requires.
pub fn requires_version(&self) -> ProtocolVersion { pub fn requires_version(self) -> ProtocolVersion {
ProtocolVersion::V1 ProtocolVersion::V1
} }
} }
@ -171,12 +171,12 @@ impl ExtXPlaylistType {
} }
/// Returns the type of the associated media playlist. /// Returns the type of the associated media playlist.
pub fn playlist_type(&self) -> PlaylistType { pub fn playlist_type(self) -> PlaylistType {
self.playlist_type self.playlist_type
} }
/// Returns the protocol compatibility version that this tag requires. /// Returns the protocol compatibility version that this tag requires.
pub fn requires_version(&self) -> ProtocolVersion { pub fn requires_version(self) -> ProtocolVersion {
ProtocolVersion::V1 ProtocolVersion::V1
} }
} }
@ -203,7 +203,7 @@ impl ExtXIFramesOnly {
pub(crate) const PREFIX: &'static str = "#EXT-X-I-FRAMES-ONLY"; pub(crate) const PREFIX: &'static str = "#EXT-X-I-FRAMES-ONLY";
/// Returns the protocol compatibility version that this tag requires. /// Returns the protocol compatibility version that this tag requires.
pub fn requires_version(&self) -> ProtocolVersion { pub fn requires_version(self) -> ProtocolVersion {
ProtocolVersion::V4 ProtocolVersion::V4
} }
} }

View file

@ -137,7 +137,7 @@ impl ExtXDiscontinuity {
pub(crate) const PREFIX: &'static str = "#EXT-X-DISCONTINUITY"; pub(crate) const PREFIX: &'static str = "#EXT-X-DISCONTINUITY";
/// Returns the protocol compatibility version that this tag requires. /// Returns the protocol compatibility version that this tag requires.
pub fn requires_version(&self) -> ProtocolVersion { pub fn requires_version(self) -> ProtocolVersion {
ProtocolVersion::V1 ProtocolVersion::V1
} }
} }

View file

@ -150,11 +150,11 @@ impl DecimalFloatingPoint {
} }
/// Converts `DecimalFloatingPoint` to `f64`. /// Converts `DecimalFloatingPoint` to `f64`.
pub fn as_f64(&self) -> f64 { pub fn as_f64(self) -> f64 {
self.0 self.0
} }
pub(crate) fn to_duration(&self) -> Duration { pub(crate) fn to_duration(self) -> Duration {
let secs = self.0 as u64; let secs = self.0 as u64;
let nanos = (self.0.fract() * 1_000_000_000.0) as u32; let nanos = (self.0.fract() * 1_000_000_000.0) as u32;
Duration::new(secs, nanos) Duration::new(secs, nanos)
@ -209,7 +209,7 @@ impl SignedDecimalFloatingPoint {
} }
/// Converts `DecimalFloatingPoint` to `f64`. /// Converts `DecimalFloatingPoint` to `f64`.
pub fn as_f64(&self) -> f64 { pub fn as_f64(self) -> f64 {
self.0 self.0
} }
} }