misc: Further improve imports styling

By introducing `imports_granularity="Module"` format strategy,
effectively groups imports from the same module into one line or block,
improving maintainability and readability.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
This commit is contained in:
Ruoqing He
2024-09-29 15:22:27 +00:00
committed by Rob Bradford
parent 9013d8b4ca
commit 61e57e1cb1
99 changed files with 358 additions and 513 deletions

View File

@@ -16,8 +16,7 @@ use virtio_queue::{Queue, QueueT};
use vm_memory::{ByteValued, Bytes, GuestMemoryError};
use vm_virtio::{AccessPlatform, Translatable};
use crate::GuestMemoryMmap;
use crate::Tap;
use crate::{GuestMemoryMmap, Tap};
#[derive(Debug)]
pub enum Error {

View File

@@ -26,7 +26,8 @@ use virtio_bindings::virtio_net::{
VIRTIO_NET_F_GUEST_CSUM, VIRTIO_NET_F_GUEST_ECN, VIRTIO_NET_F_GUEST_TSO4,
VIRTIO_NET_F_GUEST_TSO6, VIRTIO_NET_F_GUEST_UFO, VIRTIO_NET_F_MAC, VIRTIO_NET_F_MQ,
};
use vm_memory::{bitmap::AtomicBitmap, ByteValued};
use vm_memory::bitmap::AtomicBitmap;
use vm_memory::ByteValued;
type GuestMemoryMmap = vm_memory::GuestMemoryMmap<AtomicBitmap>;

View File

@@ -5,9 +5,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the THIRD-PARTY file.
use std::fmt;
use std::io;
use std::str::FromStr;
use std::{fmt, io};
use serde::de::{Deserialize, Deserializer, Error};
use serde::ser::{Serialize, Serializer};

View File

@@ -424,10 +424,9 @@ impl AsRawFd for Tap {
#[cfg(test)]
mod tests {
use std::net::Ipv4Addr;
use std::str;
use std::sync::{mpsc, Mutex};
use std::thread;
use std::time::Duration;
use std::{str, thread};
use once_cell::sync::Lazy;
use pnet::packet::ethernet::{EtherTypes, EthernetPacket, MutableEthernetPacket};