Skip to content

Commit 9d7115f

Browse files
committed
Making strict encoding net enums non-exhaustive
1 parent d5db2ba commit 9d7115f

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

Diff for: Cargo.lock

+10-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: strict_encoding/src/net.rs

+3
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ pub type RawUniformAddr = [u8; UNIFORM_LEN];
3434
Clone, Copy, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, Display, Error,
3535
)]
3636
#[display(doc_comments)]
37+
#[non_exhaustive]
3738
pub enum DecodeError {
3839
/// Unknown network address format
3940
UnknownAddrFormat,
@@ -65,6 +66,7 @@ pub enum DecodeError {
6566

6667
#[derive(Clone, Copy, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, Display)]
6768
#[repr(u8)]
69+
#[non_exhaustive]
6870
pub enum AddrFormat {
6971
#[display("ipv4")]
7072
IpV4 = 0,
@@ -84,6 +86,7 @@ pub enum AddrFormat {
8486

8587
#[derive(Clone, Copy, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, Display)]
8688
#[repr(u8)]
89+
#[non_exhaustive]
8790
pub enum Transport {
8891
/// Normal TCP
8992
#[display("tcp")]

0 commit comments

Comments
 (0)