summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSunil Nimmagadda <sunil@nimmagadda.net>2024-05-26 13:19:51 +0530
committerSunil Nimmagadda <sunil@nimmagadda.net>2024-11-15 18:54:37 +0530
commitabe878e5655d5a35f979e108456d3fac6882a354 (patch)
tree2d61e06f32b186325eebcea287bc6ff98e2d8fcb
parenta264f3d40ffd89eb4e37c3d55f28219f7c444fda (diff)
Make VRRPv2Error std::error::Error trait compliant.
-rw-r--r--src/vrrpv2.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/vrrpv2.rs b/src/vrrpv2.rs
index ca8eaec..ee2c5f7 100644
--- a/src/vrrpv2.rs
+++ b/src/vrrpv2.rs
@@ -1,4 +1,3 @@
-use std::fmt::Display;
use std::io::Read;
use std::io::{self, Cursor};
use std::net::Ipv4Addr;
@@ -45,7 +44,7 @@ pub enum VRRPv2Error {
ParseError,
}
-impl Display for VRRPv2Error {
+impl std::fmt::Display for VRRPv2Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::InvalidAuthType => write!(f, "Invalid Auth Type"),
@@ -57,6 +56,8 @@ impl Display for VRRPv2Error {
}
}
+impl std::error::Error for VRRPv2Error {}
+
#[derive(Debug, PartialEq)]
pub enum VRRPv2AuthType {
VRRPv2AuthNoAuth = 0x00,