From aaca445f98ebccbc79c980383a8db0d5aec12577 Mon Sep 17 00:00:00 2001 From: Sergio Lopez Date: Wed, 11 Sep 2024 04:44:13 +0200 Subject: [PATCH] libkrun: use unwrap_or while grabbing mac address This removes another clippy warning. Signed-off-by: Sergio Lopez --- src/libkrun/src/lib.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/libkrun/src/lib.rs b/src/libkrun/src/lib.rs index ec6f2ddd..c5007ead 100644 --- a/src/libkrun/src/lib.rs +++ b/src/libkrun/src/lib.rs @@ -978,12 +978,7 @@ pub unsafe extern "C" fn krun_set_smbios_oem_strings( #[cfg(feature = "net")] fn create_virtio_net(ctx_cfg: &mut ContextConfig, backend: VirtioNetBackend) { - let mac = if let Some(mac) = ctx_cfg.mac { - mac - } else { - // By default, use podman-machine's well-known MAC address - [0x5a, 0x94, 0xef, 0xe4, 0x0c, 0xee] - }; + let mac = ctx_cfg.mac.unwrap_or([0x5a, 0x94, 0xef, 0xe4, 0x0c, 0xee]); let network_interface_config = NetworkInterfaceConfig { iface_id: "eth0".to_string(),