summaryrefslogtreecommitdiff
path: root/src/vrrpv2.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/vrrpv2.rs')
-rw-r--r--src/vrrpv2.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vrrpv2.rs b/src/vrrpv2.rs
index 57f692a..b42cba0 100644
--- a/src/vrrpv2.rs
+++ b/src/vrrpv2.rs
@@ -83,7 +83,7 @@ pub enum AuthType {
}
impl VRRPv2 {
- pub fn to_bytes(&self) -> Result<Vec<u8>, std::io::Error> {
+ pub fn to_bytes(&self) -> Vec<u8> {
let sz = MIN_PACKET_SIZE + (self.ip_addrs.len() * 4);
let mut bytes: Vec<u8> = Vec::with_capacity(sz);
bytes.push(VERSION_TYPE);
@@ -101,7 +101,7 @@ impl VRRPv2 {
let cksum_bytes = cksum.to_be_bytes();
bytes[6] = cksum_bytes[0];
bytes[7] = cksum_bytes[1];
- Ok(bytes)
+ bytes
}
}
@@ -303,6 +303,6 @@ fn test_to_bytes() {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
];
let vrrpv2 = from_bytes(&in_bytes).expect("parsing failed");
- let out_bytes = vrrpv2.to_bytes().expect("conversion failed");
+ let out_bytes = vrrpv2.to_bytes();
assert_eq!(in_bytes.as_ref(), out_bytes);
}