agent: Use vec![] macro rather than init-then-push

We have one place where we create an empty vector then immediately push
something into it.  We can do this in one step using the vec![] macro,
which stops clippy complaining.

fixes #1611

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
David Gibson 2021-04-21 14:23:23 +10:00
parent 1c43245e3e
commit b0190a407f

View File

@ -542,12 +542,10 @@ impl Handle {
ntype: NDA_UNSPEC as u8,
},
nlas: {
let mut nlas = vec![];
nlas.push(Nla::Destination(match ip {
let mut nlas = vec![Nla::Destination(match ip {
IpAddr::V4(v4) => v4.octets().to_vec(),
IpAddr::V6(v6) => v6.octets().to_vec(),
}));
})];
if !neigh.lladdr.is_empty() {
nlas.push(Nla::LinkLocalAddress(