Skip to content

Commit

Permalink
Protect public enums with "#[non_exhaustive]".
Browse files Browse the repository at this point in the history
  • Loading branch information
yotarok committed Oct 9, 2023
1 parent ffbe7a7 commit 67eaf04
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ impl BitRepr for MetadataBlock {

/// Enum for `BLOCK_TYPE` in `METADATA_BLOCK_HEADER`.
#[allow(dead_code)]
#[non_exhaustive]
#[derive(Clone, Copy, Debug)]
enum MetadataBlockType {
StreamInfo = 0,
Expand Down
2 changes: 2 additions & 0 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ use super::bitsink::BitSink;
/// Enum of errors that can be returned in the encoder.
#[derive(Clone, Eq, Hash, PartialEq)]
#[allow(clippy::module_name_repetitions)]
#[non_exhaustive]
pub enum OutputError<S>
where
S: BitSink,
Expand Down Expand Up @@ -351,6 +352,7 @@ impl SourceError {

/// Enum covering possible error reasons from `Source`.
#[derive(Clone, Debug)]
#[non_exhaustive]
pub enum SourceErrorReason {
/// The source file cannot be opened.
Open,
Expand Down

0 comments on commit 67eaf04

Please sign in to comment.