mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-28 19:54:35 +00:00
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:
parent
1c43245e3e
commit
b0190a407f
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user