mirror of
				https://github.com/kata-containers/kata-containers.git
				synced 2025-10-31 01:13:02 +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:
		| @@ -542,12 +542,10 @@ impl Handle { | |||||||
|                 ntype: NDA_UNSPEC as u8, |                 ntype: NDA_UNSPEC as u8, | ||||||
|             }, |             }, | ||||||
|             nlas: { |             nlas: { | ||||||
|                 let mut nlas = vec![]; |                 let mut nlas = vec![Nla::Destination(match ip { | ||||||
|  |  | ||||||
|                 nlas.push(Nla::Destination(match ip { |  | ||||||
|                     IpAddr::V4(v4) => v4.octets().to_vec(), |                     IpAddr::V4(v4) => v4.octets().to_vec(), | ||||||
|                     IpAddr::V6(v6) => v6.octets().to_vec(), |                     IpAddr::V6(v6) => v6.octets().to_vec(), | ||||||
|                 })); |                 })]; | ||||||
|  |  | ||||||
|                 if !neigh.lladdr.is_empty() { |                 if !neigh.lladdr.is_empty() { | ||||||
|                     nlas.push(Nla::LinkLocalAddress( |                     nlas.push(Nla::LinkLocalAddress( | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user