Skip to content
This repository was archived by the owner on Nov 30, 2022. It is now read-only.

Commit d366d32

Browse files
committed
Add non_exhaustive to all error types
As we are doing in `rust-bitcoin`; to enhance forward compatability, and ease the upgrade path for downstream projects, add `non_exhaustive` to all error types.
1 parent 3441f35 commit d366d32

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/error.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use core::fmt;
1919

2020
/// Crate error type.
2121
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
22+
#[non_exhaustive]
2223
pub enum Error {
2324
/// Tried to create a fixed-length hash from a slice with the wrong size (expected, got).
2425
InvalidLength(usize, usize),

src/hex.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ use crate::Hash;
3030

3131
/// Hex decoding error.
3232
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
33+
#[non_exhaustive]
3334
pub enum Error {
3435
/// Non-hexadecimal character.
3536
InvalidChar(u8),

0 commit comments

Comments
 (0)