Skip to content

Commit 1e7454c

Browse files
committed
Mark DecodeError and EncodeError as non_exhaustive
Adding `#[non_exhaustive]` to `DecodeError` and `EncodeError`, so adding new enum variant will not breaking API. Signed-off-by: Gris Ge <[email protected]>
1 parent 0353682 commit 1e7454c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: src/errors.rs

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use thiserror::Error;
44

55
#[derive(Debug, Error)]
6+
#[non_exhaustive]
67
pub enum EncodeError {
78
#[error(transparent)]
89
Other(#[from] Box<dyn std::error::Error>),
@@ -23,6 +24,7 @@ impl From<String> for EncodeError {
2324
}
2425

2526
#[derive(Debug, Error)]
27+
#[non_exhaustive]
2628
pub enum DecodeError {
2729
#[error(
2830
"Invalid MAC address. Expected 6 bytes, received {received} bytes"

0 commit comments

Comments
 (0)