Skip to content

Commit

Permalink
Fix error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanRJohnston authored and traceflight committed Jun 19, 2024
1 parent 0a21996 commit d53f564
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/calc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ pub fn calculate_community_id(
disable_base64: bool,
) -> Result<String> {
match ip_proto {
IPPROTO_ICMPV6 | IPPROTO_TCP | IPPROTO_UDP | IPPROTO_SCTP => {
IPPROTO_TCP | IPPROTO_UDP | IPPROTO_SCTP => {
if src_port.is_none() || dst_port.is_none() {
return Err(anyhow!(
"src port and dst port should be set when protocol is icmp6/tcp/udp/sctp"
"src port and dst port should be set when protocol is tcp/udp/sctp"
));
}
}
Expand Down Expand Up @@ -89,7 +89,7 @@ mod tests {
);
assert!(id.is_err());
assert_eq!(
"src port and dst port should be set when protocol is icmp6/tcp/udp/sctp",
"src port and dst port should be set when protocol is tcp/udp/sctp",
id.err().unwrap().to_string()
);
}
Expand Down

0 comments on commit d53f564

Please sign in to comment.