1
0
Fork 0
mirror of https://github.com/sile/hls_m3u8.git synced 2024-11-25 16:41:00 +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};
/// This crate specific `Error` type.
#[derive(Debug, Clone)]
#[derive(Debug, Clone, TrackableError)]
pub struct Error(TrackableError<ErrorKind>);
derive_traits_for_trackable_error_newtype!(Error, ErrorKind);
/// Possible error kinds.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]

View file

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

View file

@ -15,7 +15,7 @@ impl ExtXIndependentSegments {
pub(crate) const PREFIX: &'static str = "#EXT-X-INDEPENDENT-SEGMENTS";
/// Returns the protocol compatibility version that this tag requires.
pub fn requires_version(&self) -> ProtocolVersion {
pub fn requires_version(self) -> ProtocolVersion {
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.
pub fn seq_num(&self) -> u64 {
pub fn seq_num(self) -> u64 {
self.seq_num
}
/// Returns the protocol compatibility version that this tag requires.
pub fn requires_version(&self) -> ProtocolVersion {
pub fn requires_version(self) -> ProtocolVersion {
ProtocolVersion::V1
}
}
@ -106,12 +106,12 @@ impl ExtXDiscontinuitySequence {
/// Returns the discontinuity 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
}
/// Returns the protocol compatibility version that this tag requires.
pub fn requires_version(&self) -> ProtocolVersion {
pub fn requires_version(self) -> ProtocolVersion {
ProtocolVersion::V1
}
}
@ -138,7 +138,7 @@ impl ExtXEndList {
pub(crate) const PREFIX: &'static str = "#EXT-X-ENDLIST";
/// Returns the protocol compatibility version that this tag requires.
pub fn requires_version(&self) -> ProtocolVersion {
pub fn requires_version(self) -> ProtocolVersion {
ProtocolVersion::V1
}
}
@ -171,12 +171,12 @@ impl ExtXPlaylistType {
}
/// Returns the type of the associated media playlist.
pub fn playlist_type(&self) -> PlaylistType {
pub fn playlist_type(self) -> PlaylistType {
self.playlist_type
}
/// Returns the protocol compatibility version that this tag requires.
pub fn requires_version(&self) -> ProtocolVersion {
pub fn requires_version(self) -> ProtocolVersion {
ProtocolVersion::V1
}
}
@ -203,7 +203,7 @@ impl ExtXIFramesOnly {
pub(crate) const PREFIX: &'static str = "#EXT-X-I-FRAMES-ONLY";
/// Returns the protocol compatibility version that this tag requires.
pub fn requires_version(&self) -> ProtocolVersion {
pub fn requires_version(self) -> ProtocolVersion {
ProtocolVersion::V4
}
}

View file

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

View file

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