Skip to content

Commit 3d9c490

Browse files
committed
Fix clippy warnings
1 parent f883070 commit 3d9c490

File tree

3 files changed

+32
-32
lines changed

3 files changed

+32
-32
lines changed

examples/matroska_remux.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,5 @@ fn main() {
7474
}
7575
}
7676

77-
output.write_all(&muxer.writer().as_ref().0).unwrap();
77+
output.write_all(muxer.writer().as_ref().0).unwrap();
7878
}

src/ebml.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ use nom::{
1111

1212
use crate::permutation::matroska_permutation;
1313

14-
#[derive(Debug, PartialEq)]
14+
#[derive(Debug, PartialEq, Eq)]
1515
pub struct Error<'a> {
1616
input: &'a [u8],
1717
kind: ErrorKind,
1818
}
1919

20-
#[derive(Debug, PartialEq)]
20+
#[derive(Debug, PartialEq, Eq)]
2121
pub enum ErrorKind {
2222
Nom(nom::error::ErrorKind),
2323
Custom(u8),
@@ -258,7 +258,7 @@ pub fn skip_void(input: &[u8]) -> IResult<&[u8], &[u8], Error> {
258258
.and_then(|(i, (_, size))| take(usize_error(input, size)?)(i))
259259
}
260260

261-
#[derive(Debug, Clone, PartialEq)]
261+
#[derive(Debug, Clone, PartialEq, Eq)]
262262
pub struct EBMLHeader {
263263
pub version: u64,
264264
pub read_version: u64,

src/elements.rs

+28-28
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ pub fn segment_element(input: &[u8]) -> IResult<&[u8], SegmentElement, Error> {
6767
})
6868
}
6969

70-
#[derive(Debug, Clone, PartialEq)]
70+
#[derive(Debug, Clone, PartialEq, Eq)]
7171
pub struct SeekHead {
7272
pub positions: Vec<Seek>,
7373
}
@@ -79,7 +79,7 @@ pub fn seek_head(input: &[u8]) -> IResult<&[u8], SegmentElement, Error> {
7979
})(input)
8080
}
8181

82-
#[derive(Debug, Clone, PartialEq)]
82+
#[derive(Debug, Clone, PartialEq, Eq)]
8383
pub struct Seek {
8484
pub id: Vec<u8>,
8585
pub position: u64,
@@ -163,7 +163,7 @@ pub fn info(input: &[u8]) -> IResult<&[u8], SegmentElement, Error> {
163163
})
164164
}
165165

166-
#[derive(Debug, Clone, PartialEq)]
166+
#[derive(Debug, Clone, PartialEq, Eq)]
167167
pub struct ChapterTranslate {}
168168

169169
//https://datatracker.ietf.org/doc/html/draft-lhomme-cellar-matroska-03#section-7.3.16
@@ -172,7 +172,7 @@ pub fn chapter_translate(input: &[u8]) -> IResult<&[u8], ChapterTranslate, Error
172172
}
173173

174174
//https://datatracker.ietf.org/doc/html/draft-lhomme-cellar-matroska-03#section-7.3.26
175-
#[derive(Debug, Clone, PartialEq)]
175+
#[derive(Debug, Clone, PartialEq, Eq)]
176176
pub struct Cluster<'a> {
177177
pub timecode: u64,
178178
pub silent_tracks: Option<SilentTracks>,
@@ -209,7 +209,7 @@ pub fn cluster(input: &[u8]) -> IResult<&[u8], SegmentElement, Error> {
209209
})
210210
}
211211

212-
#[derive(Debug, Clone, PartialEq)]
212+
#[derive(Debug, Clone, PartialEq, Eq)]
213213
pub struct SilentTracks {
214214
pub numbers: Vec<u64>,
215215
}
@@ -221,7 +221,7 @@ pub fn silent_tracks(input: &[u8]) -> IResult<&[u8], SilentTracks, Error> {
221221
})(input)
222222
}
223223

224-
#[derive(Debug, Clone, PartialEq)]
224+
#[derive(Debug, Clone, PartialEq, Eq)]
225225
pub struct BlockGroup<'a> {
226226
pub block: &'a [u8],
227227
pub block_virtual: Option<Vec<u8>>,
@@ -273,31 +273,31 @@ pub fn block_group(input: &[u8]) -> IResult<&[u8], BlockGroup, Error> {
273273
})(input)
274274
}
275275

276-
#[derive(Debug, Clone, PartialEq)]
276+
#[derive(Debug, Clone, PartialEq, Eq)]
277277
pub struct BlockAdditions {}
278278

279279
//https://datatracker.ietf.org/doc/html/draft-lhomme-cellar-matroska-03#section-7.3.16
280280
pub fn block_additions(input: &[u8]) -> IResult<&[u8], BlockAdditions, Error> {
281281
ebml_master(0x75A1, |i| Ok((i, BlockAdditions {})))(input)
282282
}
283283

284-
#[derive(Debug, Clone, PartialEq)]
284+
#[derive(Debug, Clone, PartialEq, Eq)]
285285
pub struct Slices {}
286286

287287
//https://datatracker.ietf.org/doc/html/draft-lhomme-cellar-matroska-03#section-7.3.46
288288
pub fn slices(input: &[u8]) -> IResult<&[u8], Slices, Error> {
289289
ebml_master(0x8E, |i| Ok((i, Slices {})))(input)
290290
}
291291

292-
#[derive(Debug, Clone, PartialEq)]
292+
#[derive(Debug, Clone, PartialEq, Eq)]
293293
pub struct ReferenceFrame {}
294294

295295
//https://datatracker.ietf.org/doc/html/draft-lhomme-cellar-matroska-03#section-7.3.53
296296
pub fn reference_frame(input: &[u8]) -> IResult<&[u8], ReferenceFrame, Error> {
297297
ebml_master(0xC8, |i| Ok((i, ReferenceFrame {})))(input)
298298
}
299299

300-
#[derive(Debug, Clone, PartialEq)]
300+
#[derive(Debug, Clone, PartialEq, Eq)]
301301
pub struct Block {
302302
pub track_number: u64,
303303
pub timecode: i16,
@@ -317,15 +317,15 @@ pub fn block(input: &[u8]) -> IResult<&[u8], Block, Error> {
317317
)(input)
318318
}
319319

320-
#[derive(Debug, Clone, PartialEq)]
320+
#[derive(Debug, Clone, PartialEq, Eq)]
321321
pub struct BlockFlags {
322322
pub keyframe: bool,
323323
pub invisible: bool,
324324
pub lacing: Lacing,
325325
pub discardable: bool,
326326
}
327327

328-
#[derive(Debug, Clone, PartialEq)]
328+
#[derive(Debug, Clone, PartialEq, Eq)]
329329
pub struct SimpleBlock {
330330
pub track_number: u64,
331331
pub timecode: i16,
@@ -367,23 +367,23 @@ pub fn simple_block(input: &[u8]) -> IResult<&[u8], SimpleBlock, Error> {
367367
)(input)
368368
}
369369

370-
#[derive(Debug, Clone, PartialEq)]
370+
#[derive(Debug, Clone, PartialEq, Eq)]
371371
pub struct SimpleBlockFlags {
372372
pub keyframe: bool,
373373
pub invisible: bool,
374374
pub lacing: Lacing,
375375
pub discardable: bool,
376376
}
377377

378-
#[derive(Debug, Clone, PartialEq)]
378+
#[derive(Debug, Clone, PartialEq, Eq)]
379379
pub enum Lacing {
380380
None,
381381
Xiph,
382382
EBML,
383383
FixedSize,
384384
}
385385

386-
#[derive(Debug, Clone, PartialEq)]
386+
#[derive(Debug, Clone, PartialEq, Eq)]
387387
pub struct LacedData {
388388
pub frame_count: u8,
389389
}
@@ -570,7 +570,7 @@ pub fn track_entry(input: &[u8]) -> IResult<&[u8], TrackEntry, Error> {
570570
})(input)
571571
}
572572

573-
#[derive(Debug, Clone, PartialEq)]
573+
#[derive(Debug, Clone, PartialEq, Eq)]
574574
pub struct TrackTranslate {
575575
pub edition_uid: Vec<u64>,
576576
pub codec: u64,
@@ -597,7 +597,7 @@ pub fn track_translate(input: &[u8]) -> IResult<&[u8], TrackTranslate, Error> {
597597
})(input)
598598
}
599599

600-
#[derive(Debug, Clone, PartialEq)]
600+
#[derive(Debug, Clone, PartialEq, Eq)]
601601
pub struct TrackOperation {
602602
pub combine_planes: Option<TrackCombinePlanes>,
603603
pub join_blocks: Option<TrackJoinBlocks>,
@@ -615,7 +615,7 @@ pub fn track_operation(input: &[u8]) -> IResult<&[u8], TrackOperation, Error> {
615615
})(input)
616616
}
617617

618-
#[derive(Debug, Clone, PartialEq)]
618+
#[derive(Debug, Clone, PartialEq, Eq)]
619619
pub struct TrackCombinePlanes {
620620
pub track_planes: Vec<TrackPlane>,
621621
}
@@ -628,7 +628,7 @@ pub fn track_combine_planes(input: &[u8]) -> IResult<&[u8], TrackCombinePlanes,
628628
})(input)
629629
}
630630

631-
#[derive(Debug, Clone, PartialEq)]
631+
#[derive(Debug, Clone, PartialEq, Eq)]
632632
pub struct TrackPlane {
633633
pub uid: u64,
634634
pub plane_type: u64,
@@ -650,7 +650,7 @@ pub fn track_plane(input: &[u8]) -> IResult<&[u8], TrackPlane, Error> {
650650
})(input)
651651
}
652652

653-
#[derive(Debug, Clone, PartialEq)]
653+
#[derive(Debug, Clone, PartialEq, Eq)]
654654
pub struct TrackJoinBlocks {
655655
pub uid: Vec<u64>,
656656
}
@@ -663,7 +663,7 @@ pub fn track_join_blocks(input: &[u8]) -> IResult<&[u8], TrackJoinBlocks, Error>
663663
})(input)
664664
}
665665

666-
#[derive(Debug, Clone, PartialEq)]
666+
#[derive(Debug, Clone, PartialEq, Eq)]
667667
pub struct ContentEncodings {
668668
pub content_encoding: Vec<ContentEncoding>,
669669
}
@@ -676,7 +676,7 @@ pub fn content_encodings(input: &[u8]) -> IResult<&[u8], ContentEncodings, Error
676676
})(input)
677677
}
678678

679-
#[derive(Debug, Clone, PartialEq)]
679+
#[derive(Debug, Clone, PartialEq, Eq)]
680680
pub struct ContentEncoding {
681681
order: u64,
682682
scope: u64,
@@ -709,7 +709,7 @@ pub fn content_encoding(input: &[u8]) -> IResult<&[u8], ContentEncoding, Error>
709709
})(input)
710710
}
711711

712-
#[derive(Debug, Clone, PartialEq)]
712+
#[derive(Debug, Clone, PartialEq, Eq)]
713713
pub struct ContentCompression {
714714
algo: u64,
715715
settings: Option<u64>,
@@ -730,7 +730,7 @@ pub fn content_compression(input: &[u8]) -> IResult<&[u8], ContentCompression, E
730730
})(input)
731731
}
732732

733-
#[derive(Debug, Clone, PartialEq)]
733+
#[derive(Debug, Clone, PartialEq, Eq)]
734734
pub struct ContentEncryption {
735735
enc_algo: Option<u64>,
736736
enc_key_id: Option<Vec<u8>>,
@@ -1009,21 +1009,21 @@ pub fn projection(input: &[u8]) -> IResult<&[u8], Projection, Error> {
10091009
})(input)
10101010
}
10111011

1012-
#[derive(Debug, Clone, PartialEq)]
1012+
#[derive(Debug, Clone, PartialEq, Eq)]
10131013
pub struct Chapters {}
10141014

10151015
//https://datatracker.ietf.org/doc/html/draft-lhomme-cellar-matroska-03#section-7.3.199
10161016
pub fn chapters(input: &[u8]) -> IResult<&[u8], SegmentElement, Error> {
10171017
ebml_master(0x45B9, |i| Ok((i, SegmentElement::Chapters(Chapters {}))))(input)
10181018
}
10191019

1020-
#[derive(Debug, Clone, PartialEq)]
1020+
#[derive(Debug, Clone, PartialEq, Eq)]
10211021
pub struct Cues {}
10221022

1023-
#[derive(Debug, Clone, PartialEq)]
1023+
#[derive(Debug, Clone, PartialEq, Eq)]
10241024
pub struct Attachments {}
10251025

1026-
#[derive(Debug, Clone, PartialEq)]
1026+
#[derive(Debug, Clone, PartialEq, Eq)]
10271027
pub struct Tags {}
10281028

10291029
#[cfg(test)]

0 commit comments

Comments
 (0)