Skip to content

Commit

Permalink
Make Error and GameType enums non-exhaustive
Browse files Browse the repository at this point in the history
So that it's not a breaking change to add more variants in the future.
  • Loading branch information
Ortham committed Jan 24, 2025
1 parent aa0a34a commit b2ee59f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use nom::error::ErrorKind;
use nom::Err;

#[derive(Debug)]
#[non_exhaustive]
pub enum Error {
ParsingIncomplete(MoreDataNeeded),
// The string is the input that was not parsed.
Expand Down
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ use function::Function;

type ParsingResult<'a, T> = IResult<&'a str, T, ParsingError<&'a str>>;

// GameType variants must not change order, as their integer values are used as
// constants in the C API.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
#[non_exhaustive]
pub enum GameType {
Oblivion,
Skyrim,
Expand Down

0 comments on commit b2ee59f

Please sign in to comment.