From ec5906f32dba51b3ab1ea85c581de84f41088e5f Mon Sep 17 00:00:00 2001 From: Sunil Nimmagadda Date: Sun, 24 Nov 2024 10:34:32 +0530 Subject: Merge two write_all. --- src/vrrpv2.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/vrrpv2.rs') diff --git a/src/vrrpv2.rs b/src/vrrpv2.rs index 3ad19b6..df9d523 100644 --- a/src/vrrpv2.rs +++ b/src/vrrpv2.rs @@ -108,12 +108,11 @@ impl VRRPv2 { self.virtual_router_id, self.priority, self.count_ip_addrs, + self.auth_type as u8, + self.advertisement_interval, ] .as_ref(), )?; - wr.write_all( - [self.auth_type as u8, self.advertisement_interval].as_ref(), - )?; wr.write_all(self.checksum.to_be_bytes().as_ref())?; for ip in self.ip_addrs.iter() { wr.write_all(&ip.to_bits().to_be_bytes())?; -- cgit v1.2.3