Skip to content

Commit

Permalink
Add non_exhaustive to error enums
Browse files Browse the repository at this point in the history
  • Loading branch information
reknih committed Nov 24, 2023
1 parent 3a554f0 commit a52b20b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ impl fmt::Display for ParseError {
///
/// Also see [`ParseError`].
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive]
pub enum ParseErrorKind {
/// The file ended prematurely.
UnexpectedEof,
Expand Down Expand Up @@ -516,7 +517,7 @@ impl<'s> Pair<'s> {
/// Whether a character is allowed in an entry key
#[inline]
pub fn is_key(c: char) -> bool {
!matches!(c, ',' | '}' ) && !c.is_control() && !c.is_whitespace()
!matches!(c, ',' | '}') && !c.is_control() && !c.is_whitespace()
}

/// Whether a character can start an identifier.
Expand Down
1 change: 1 addition & 0 deletions src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ impl fmt::Display for TypeError {
///
/// Also see [`TypeError`].
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive]
pub enum TypeErrorKind {
/// The date range was open on both sides.
UndefinedRange,
Expand Down

0 comments on commit a52b20b

Please sign in to comment.