build: treewide: fmt for edition 2024

`cargo +nightly fmt`

Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
On-behalf-of: SAP philipp.schuster@sap.com
This commit is contained in:
Philipp Schuster
2025-08-12 12:59:23 +02:00
committed by Bo Chen
parent 061351d82d
commit 363273111a
121 changed files with 781 additions and 663 deletions

View File

@@ -15,8 +15,8 @@ use thiserror::Error;
use vmm_sys_util::ioctl::{ioctl_with_mut_ref, ioctl_with_ref, ioctl_with_val};
use super::{
create_inet_socket, create_sockaddr, create_unix_socket, vnet_hdr_len, Error as NetUtilError,
MacAddr,
Error as NetUtilError, MacAddr, create_inet_socket, create_sockaddr, create_unix_socket,
vnet_hdr_len,
};
use crate::mac::MAC_ADDR_LEN;
@@ -551,7 +551,7 @@ impl AsRawFd for Tap {
#[cfg(test)]
mod tests {
use std::net::Ipv4Addr;
use std::sync::{mpsc, LazyLock, Mutex};
use std::sync::{LazyLock, Mutex, mpsc};
use std::time::Duration;
use std::{str, thread};
@@ -860,15 +860,17 @@ mod tests {
// We use a separate thread to wait for the test packet because the API exposed by pnet is
// blocking. This thread will be killed when the main thread exits.
let _handle = thread::spawn(move || loop {
let buf = rx.next().unwrap();
let p = ParsedPkt::new(buf);
p.print();
let _handle = thread::spawn(move || {
loop {
let buf = rx.next().unwrap();
let p = ParsedPkt::new(buf);
p.print();
if let Some(ref udp) = p.udp {
if payload == udp.payload() {
channel_tx.send(true).unwrap();
break;
if let Some(ref udp) = p.udp {
if payload == udp.payload() {
channel_tx.send(true).unwrap();
break;
}
}
}
});