Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Luni-4 committed Aug 24, 2022
1 parent 987edfc commit fc2e0cd
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions data/src/audiosample.rs
Expand Up @@ -2,7 +2,7 @@ use std::fmt;
use std::string::*;

/// Audio format definition.
#[derive(Debug, Copy, Clone, PartialEq)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct Soniton {
/// Bits per sample.
pub bits: u8,
Expand Down Expand Up @@ -77,7 +77,7 @@ impl fmt::Display for Soniton {
}

/// Known audio channel types.
#[derive(Debug, Clone, Copy, PartialEq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[allow(clippy::upper_case_acronyms)]
pub enum ChannelType {
C,
Expand Down Expand Up @@ -198,7 +198,7 @@ impl fmt::Display for ChannelType {
}

/// An ordered sequence of channels.
#[derive(Clone, Debug, PartialEq, Default)]
#[derive(Clone, Debug, PartialEq, Eq, Default)]
pub struct ChannelMap {
ids: Vec<ChannelType>,
}
Expand Down
2 changes: 1 addition & 1 deletion data/src/frame.rs
Expand Up @@ -29,7 +29,7 @@ pub enum FrameError {

// TODO: Change it to provide Droppable/Seekable information or use a separate enum?
/// A list of recognized frame types.
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
#[allow(clippy::upper_case_acronyms)]
pub enum FrameType {
/// Intra frame type.
Expand Down
8 changes: 4 additions & 4 deletions data/src/params.rs
Expand Up @@ -3,7 +3,7 @@ use crate::pixel::Formaton;
use std::sync::Arc;

/// Video stream information.
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct VideoInfo {
/// Picture width.
pub width: usize,
Expand All @@ -14,7 +14,7 @@ pub struct VideoInfo {
}

/// Audio stream information.
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct AudioInfo {
/// Audio sample rate.
pub rate: usize,
Expand All @@ -25,7 +25,7 @@ pub struct AudioInfo {
}

/// Possible stream information types.
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum MediaKind {
/// Video codec information.
Video(VideoInfo),
Expand All @@ -34,7 +34,7 @@ pub enum MediaKind {
}

/// Possible codec parameters.
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct CodecParams {
/// Stream information type.
pub kind: Option<MediaKind>,
Expand Down
20 changes: 10 additions & 10 deletions data/src/pixel.rs
Expand Up @@ -14,7 +14,7 @@ use std::ops::Index;
use std::slice;

/// YUV color range.
#[derive(Debug, Clone, Copy, PartialEq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[allow(clippy::upper_case_acronyms)]
pub enum YUVRange {
/// Pixels in the range [16, 235].
Expand All @@ -34,7 +34,7 @@ impl fmt::Display for YUVRange {

/// Values adopted from Table 4 of ISO/IEC 23001-8:2013/DCOR1.
#[allow(clippy::upper_case_acronyms)]
#[derive(Debug, Clone, Copy, PartialEq, FromPrimitive, ToPrimitive)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, FromPrimitive, ToPrimitive)]
pub enum MatrixCoefficients {
Identity = 0,
BT709 = 1,
Expand Down Expand Up @@ -84,7 +84,7 @@ impl fmt::Display for MatrixCoefficients {
}

/// Values adopted from Table 4 of ISO/IEC 23001-8:2013/DCOR1.
#[derive(Debug, Clone, Copy, PartialEq, FromPrimitive, ToPrimitive)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, FromPrimitive, ToPrimitive)]
#[allow(clippy::upper_case_acronyms)]
pub enum ColorPrimaries {
Reserved0 = 0,
Expand Down Expand Up @@ -125,7 +125,7 @@ impl fmt::Display for ColorPrimaries {
}

/// Values adopted from Table 4 of ISO/IEC 23001-8:2013/DCOR1.
#[derive(Debug, Clone, Copy, PartialEq, FromPrimitive, ToPrimitive)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, FromPrimitive, ToPrimitive)]
#[allow(clippy::upper_case_acronyms)]
pub enum TransferCharacteristic {
Reserved0 = 0,
Expand Down Expand Up @@ -176,7 +176,7 @@ impl fmt::Display for TransferCharacteristic {
}

/// Values adopted from Table 4 of ISO/IEC 23001-8:2013/DCOR1.
#[derive(Debug, Clone, Copy, PartialEq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ChromaLocation {
Unspecified = 0,
Left,
Expand All @@ -203,7 +203,7 @@ impl fmt::Display for ChromaLocation {
}

/// All YUV color representations.
#[derive(Debug, Clone, Copy, PartialEq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[allow(clippy::upper_case_acronyms)]
pub enum YUVSystem {
YCbCr(YUVRange),
Expand All @@ -223,7 +223,7 @@ impl fmt::Display for YUVSystem {
}

/// Trichromatic color encoding system.
#[derive(Debug, Clone, Copy, PartialEq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[allow(clippy::upper_case_acronyms)]
pub enum TrichromaticEncodingSystem {
RGB,
Expand All @@ -243,7 +243,7 @@ impl fmt::Display for TrichromaticEncodingSystem {
}

/// All supported color models.
#[derive(Debug, Clone, Copy, PartialEq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[allow(clippy::upper_case_acronyms)]
pub enum ColorModel {
Trichromatic(TrichromaticEncodingSystem),
Expand Down Expand Up @@ -277,7 +277,7 @@ impl ColorModel {
///
/// Defines how the components of a colorspace are subsampled and
/// where and how they are stored.
#[derive(Clone, Copy, Debug, PartialEq)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct Chromaton {
/// Horizontal subsampling in power of two
/// (e.g. `0` = no subsampling, `1` = only every second value is stored).
Expand Down Expand Up @@ -418,7 +418,7 @@ impl fmt::Display for Chromaton {
///
/// For example, the format can be paletted, so the components describe
/// the palette storage format, while the actual data is 8-bit palette indices.
#[derive(Clone, Copy, PartialEq, Debug)]
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
pub struct Formaton {
/// Image color model.
pub model: ColorModel,
Expand Down
2 changes: 1 addition & 1 deletion format/src/demuxer.rs
Expand Up @@ -168,7 +168,7 @@ impl<D: Demuxer, R: Buffered> Context<D, R> {
/// Format descriptor.
///
/// Contains information on a format and its own demuxer.
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Descr {
/// Format name.
pub name: &'static str,
Expand Down
2 changes: 1 addition & 1 deletion format/src/muxer.rs
Expand Up @@ -217,7 +217,7 @@ impl<M: Muxer, WO: WriteOwned, WS: WriteSeek> Context<M, WO, WS> {
/// Format descriptor.
///
/// Contains information on a format and its own muxer.
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Descr {
/// Format name.
pub name: &'static str,
Expand Down

0 comments on commit fc2e0cd

Please sign in to comment.