Skip to content

Commit

Permalink
libkrun: use unwrap_or while grabbing mac address
Browse files Browse the repository at this point in the history
This removes another clippy warning.

Signed-off-by: Sergio Lopez <[email protected]>
  • Loading branch information
slp committed Sep 11, 2024
1 parent dffcaf3 commit aaca445
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/libkrun/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit aaca445

Please sign in to comment.