Skip to content

Commit

Permalink
fixup: rename packet dir
Browse files Browse the repository at this point in the history
  • Loading branch information
dlon committed Jul 23, 2024
1 parent a565819 commit 0809447
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ pub enum ErrorKind {
/// The address family is invalid
InvalidAddressFamily,
/// The direction is invalid
InvalidPacketDirection,
InvalidDirection,
/// The transport protocol is invalid
InvalidTransportProtocol,
/// The target state was already active
Expand All @@ -137,7 +137,7 @@ enum ErrorInternal {
InvalidPortRange,
InvalidLabel(&'static str),
InvalidAddressFamily(u8),
InvalidPacketDirection(u8),
InvalidDirection(u8),
InvalidTransportProtocol(u8),
StateAlreadyActive,
AnchorDoesNotExist,
Expand All @@ -156,7 +156,7 @@ impl Error {
InvalidPortRange => ErrorKind::InvalidPortRange,
InvalidLabel(..) => ErrorKind::InvalidLabel,
InvalidAddressFamily(_) => ErrorKind::InvalidAddressFamily,
InvalidPacketDirection(_) => ErrorKind::InvalidPacketDirection,
InvalidDirection(_) => ErrorKind::InvalidDirection,
InvalidTransportProtocol(_) => ErrorKind::InvalidTransportProtocol,
StateAlreadyActive => ErrorKind::StateAlreadyActive,
AnchorDoesNotExist => ErrorKind::AnchorDoesNotExist,
Expand Down Expand Up @@ -184,7 +184,7 @@ impl fmt::Display for Error {
InvalidPortRange => write!(f, "Lower port is greater than upper port"),
InvalidLabel(reason) => write!(f, "Invalid rule label ({reason}"),
InvalidAddressFamily(reason) => write!(f, "Invalid address family ({reason})"),
InvalidPacketDirection(reason) => write!(f, "Invalid direction ({reason})"),
InvalidDirection(reason) => write!(f, "Invalid direction ({reason})"),
InvalidTransportProtocol(reason) => write!(f, "Invalid transport protocol ({reason})"),
StateAlreadyActive => write!(f, "Target state is already active"),
AnchorDoesNotExist => write!(f, "Anchor does not exist"),
Expand Down
2 changes: 1 addition & 1 deletion src/rule/direction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl TryFrom<u8> for Direction {
INOUT => Ok(Direction::Any),
IN => Ok(Direction::In),
OUT => Ok(Direction::Out),
other => Err(Error::from(ErrorInternal::InvalidPacketDirection(other))),
other => Err(Error::from(ErrorInternal::InvalidDirection(other))),
}
}
}

0 comments on commit 0809447

Please sign in to comment.