Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
thearossman committed Jun 9, 2024
1 parent 4984504 commit 09340b2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions core/src/port/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 09340b2

Please sign in to comment.