summaryrefslogtreecommitdiff
path: root/src/vrrpv2.rs
diff options
context:
space:
mode:
authorSunil Nimmagadda <sunil@nimmagadda.net>2024-01-30 16:25:28 +0530
committerSunil Nimmagadda <sunil@nimmagadda.net>2024-01-30 16:25:28 +0530
commitc9b3751f061b340e3e92aecd530dfc9d48f9e2cc (patch)
tree1dc59d02f8aa49879ee481fd862c02d958b35390 /src/vrrpv2.rs
parentd9170bd0853b82d74a6108cfa84f74a2582fbfa8 (diff)
Use with_capacity as it's known by now.
Diffstat (limited to 'src/vrrpv2.rs')
-rw-r--r--src/vrrpv2.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vrrpv2.rs b/src/vrrpv2.rs
index e0f45a6..aabe60a 100644
--- a/src/vrrpv2.rs
+++ b/src/vrrpv2.rs
@@ -112,7 +112,7 @@ fn parse(bytes: &[u8]) -> Result<VRRPv2, VRRPv2Error> {
let Ok(checksum) = rdr.read_u16() else {
return Err(VRRPv2Error::ParseError);
};
- let mut ip_addrs = Vec::new();
+ let mut ip_addrs = Vec::with_capacity(count_ip_addrs as usize);
for _i in 0..count_ip_addrs {
let Ok(b) = rdr.read_u32() else {
return Err(VRRPv2Error::ParseError);