Skip to content

Commit

Permalink
Making strict encoding net enums non-exhaustive
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Jan 19, 2021
1 parent d5db2ba commit 9d7115f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions strict_encoding/src/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ pub type RawUniformAddr = [u8; UNIFORM_LEN];
Clone, Copy, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, Display, Error,
)]
#[display(doc_comments)]
#[non_exhaustive]
pub enum DecodeError {
/// Unknown network address format
UnknownAddrFormat,
Expand Down Expand Up @@ -65,6 +66,7 @@ pub enum DecodeError {

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

#[derive(Clone, Copy, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, Display)]
#[repr(u8)]
#[non_exhaustive]
pub enum Transport {
/// Normal TCP
#[display("tcp")]
Expand Down

0 comments on commit 9d7115f

Please sign in to comment.