mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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:
committed by
Bo Chen
parent
061351d82d
commit
363273111a
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user