From 09340b2d2384c793383596f0a4b294bba906594c Mon Sep 17 00:00:00 2001 From: Thea Date: Sun, 9 Jun 2024 10:22:35 -0700 Subject: [PATCH] cargo fmt --- core/src/port/mod.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core/src/port/mod.rs b/core/src/port/mod.rs index 59ef5297..4a52a188 100644 --- a/core/src/port/mod.rs +++ b/core/src/port/mod.rs @@ -34,11 +34,10 @@ impl PortId { pub fn new_from_device(device: String) -> PortId { let mut port_id: u16 = 0; let _device = device.clone(); - let ret = - unsafe { - let dev_name = CString::new(device).unwrap(); - dpdk::rte_eth_dev_get_port_by_name(dev_name.as_ptr(), &mut port_id) - }; + let ret = unsafe { + let dev_name = CString::new(device).unwrap(); + dpdk::rte_eth_dev_get_port_by_name(dev_name.as_ptr(), &mut port_id) + }; if ret != 0 { panic!("Failed to find device by name {}", _device); }