Skip to content

Commit

Permalink
Derive PartialEq for StreamInfo and SeekPoint
Browse files Browse the repository at this point in the history
These structures can be compared for equality, and having them be
PartialEq means we can easily write tests for them.
  • Loading branch information
antifuchs committed Dec 26, 2021
1 parent 66bf343 commit 65d2551
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct MetadataBlockHeader {
}

/// The streaminfo metadata block, with important information about the stream.
#[derive(Clone, Copy, Debug)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct StreamInfo {
// TODO: "size" would better be called "duration" for clarity.
/// The minimum block size (in inter-channel samples) used in the stream.
Expand Down Expand Up @@ -54,7 +54,7 @@ pub struct StreamInfo {
}

/// A seek point in the seek table.
#[derive(Clone, Copy)]
#[derive(Clone, Copy, PartialEq)]
pub struct SeekPoint {
/// Sample number of the first sample in the target frame, or 2<sup>64</sup> - 1 for a placeholder.
pub sample: u64,
Expand Down

0 comments on commit 65d2551

Please sign in to comment.