Clippy: misc

This commit is contained in:
Serial 2022-06-10 08:35:26 -04:00
parent fa2a263a5c
commit 829b3e0e95
No known key found for this signature in database
GPG key ID: DA95198DC17C4568
14 changed files with 17 additions and 16 deletions

View file

@ -276,7 +276,7 @@ impl Page {
}
}
#[allow(clippy::eval_order_dependence)]
#[allow(clippy::mixed_read_write_in_expression)]
/// Create pages from a packet
///
/// # Example

View file

@ -49,7 +49,7 @@ macro_rules! impl_accessor {
}
}
#[derive(Default, Debug, PartialEq, Clone)]
#[derive(Default, Debug, PartialEq, Eq, Clone)]
/// An `APE` tag
///
/// ## Supported file types

View file

@ -2,8 +2,8 @@ use crate::error::{Id3v2Error, Id3v2ErrorKind, LoftyError, Result};
use crate::tag::item::ItemKey;
use crate::tag::TagType;
#[derive(PartialEq, Clone, Debug, Eq, Hash)]
/// An `ID3v2` frame ID
#[derive(PartialEq, Clone, Debug, Eq, Hash)]
pub enum FrameID {
/// A valid `ID3v2.3/4` frame
Valid(String),

View file

@ -23,7 +23,6 @@ use std::hash::{Hash, Hasher};
// TODO: Messy module, rough conversions
#[derive(Clone, Debug, Eq)]
/// Represents an `ID3v2` frame
///
/// ## Outdated Frames
@ -38,6 +37,7 @@ use std::hash::{Hash, Hasher};
///
/// `ID3v2.3`, unlike `ID3v2.2`, stores frame IDs in 4 characters like `ID3v2.4`. There are some IDs that need upgrading (See [`upgrade_v3`]),
/// but anything that fails to be upgraded **will not** be stored as [`FrameID::Outdated`], as it is likely not an issue to write.
#[derive(Clone, Debug, Eq)]
pub struct Frame {
pub(super) id: FrameID,
pub(super) value: FrameValue,
@ -114,9 +114,9 @@ impl Frame {
}
}
/// The value of an `ID3v2` frame
#[non_exhaustive]
#[derive(PartialEq, Clone, Debug, Eq, Hash)]
/// The value of an `ID3v2` frame
pub enum FrameValue {
/// Represents a "COMM" frame
///
@ -203,9 +203,9 @@ impl FrameValue {
}
}
/// Various flags to describe the content of an item
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Default)]
#[allow(clippy::struct_excessive_bools)]
/// Various flags to describe the content of an item
pub struct FrameFlags {
/// Preserve frame on tag edit
pub tag_alter_preservation: bool,

View file

@ -197,7 +197,7 @@ impl SynchronizedText {
&& information
.language
.chars()
.all(|c| ('a'..'z').contains(&c))
.all(|c| ('a'..='z').contains(&c))
{
data.write_all(information.language.as_bytes())?;
data.write_u8(information.timestamp_format as u8)?;

View file

@ -58,7 +58,7 @@ impl Default for ImageSizeRestrictions {
}
}
#[derive(Default, Clone, Copy, Debug, PartialEq)]
#[derive(Default, Clone, Copy, Debug, PartialEq, Eq)]
/// Restrictions on the content of an ID3v2 tag
pub struct TagRestrictions {
/// Restriction on the size of the tag. See [`TagSizeRestrictions`]

View file

@ -59,7 +59,7 @@ pub struct Comment {
/// * [`ItemKey::Comment`](crate::ItemKey::Comment)
///
/// When converting [Comment]s, only the `text` field will be preserved.
#[derive(Default, Clone, Debug, PartialEq)]
#[derive(Default, Clone, Debug, PartialEq, Eq)]
pub struct AiffTextChunks {
/// The name of the piece
pub name: Option<String>,

View file

@ -25,7 +25,7 @@ impl Default for WavFormat {
}
}
#[derive(Debug, Copy, Clone, PartialEq, Default)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Default)]
#[non_exhaustive]
/// A WAV file's audio properties
pub struct WavProperties {

View file

@ -163,7 +163,8 @@
clippy::tabs_in_doc_comments,
clippy::len_without_is_empty,
clippy::needless_late_init,
clippy::type_complexity
clippy::type_complexity,
clippy::type_repetition_in_bounds
)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

View file

@ -8,7 +8,7 @@ use std::time::Duration;
use byteorder::{BigEndian, ReadBytesExt};
#[derive(Debug, Clone, Copy, PartialEq, Default)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
#[non_exhaustive]
/// An MP3 file's audio properties
pub struct Mp3Properties {

View file

@ -143,7 +143,7 @@ impl TryFrom<u8> for AudioObjectType {
}
}
#[derive(Debug, Clone, PartialEq, Default)]
#[derive(Debug, Clone, PartialEq, Eq, Default)]
#[non_exhaustive]
/// An MP4 file's audio properties
pub struct Mp4Properties {

View file

@ -34,7 +34,6 @@ macro_rules! impl_accessor {
}
}
#[derive(Default, PartialEq, Eq, Debug, Clone)]
/// Vorbis comments
///
/// ## Supported file types
@ -43,6 +42,7 @@ macro_rules! impl_accessor {
/// * [`FileType::Opus`](crate::FileType::Opus)
/// * [`FileType::Speex`](crate::FileType::Speex)
/// * [`FileType::Vorbis`](crate::FileType::Vorbis)
#[derive(Default, PartialEq, Eq, Debug, Clone)]
pub struct VorbisComments {
/// An identifier for the encoding software
pub(crate) vendor: String,

View file

@ -15,7 +15,7 @@ use std::io::{Cursor, Read, Seek, SeekFrom, Write};
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
use ogg_pager::Page;
#[derive(PartialEq, Eq, Copy, Clone)]
#[derive(PartialEq, Copy, Clone)]
pub(crate) enum OGGFormat {
Opus,
Vorbis,

View file

@ -105,7 +105,7 @@ impl MimeType {
MimeType::Tiff => "image/tiff",
MimeType::Bmp => "image/bmp",
MimeType::Gif => "image/gif",
MimeType::Unknown(unknown) => &*unknown,
MimeType::Unknown(unknown) => unknown,
MimeType::None => "",
}
}