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
+1 -3
View File
@@ -27,9 +27,7 @@ use vm_memory::{
GuestMemoryRegion, GuestUsize,
};
use crate::GuestMemoryMmap;
use crate::InitramfsConfig;
use crate::RegionType;
use crate::{GuestMemoryMmap, InitramfsConfig, RegionType};
mod smbios;
use std::arch::x86_64;
#[cfg(feature = "tdx")]
+3 -6
View File
@@ -5,9 +5,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE-BSD-3-Clause file.
use std::mem;
use std::result;
use std::slice;
use std::{mem, result, slice};
use libc::c_uchar;
use thiserror::Error;
@@ -306,9 +304,8 @@ pub fn setup_mptable(
#[cfg(test)]
mod tests {
use vm_memory::{
bitmap::BitmapSlice, GuestUsize, VolatileMemoryError, VolatileSlice, WriteVolatile,
};
use vm_memory::bitmap::BitmapSlice;
use vm_memory::{GuestUsize, VolatileMemoryError, VolatileSlice, WriteVolatile};
use super::*;
use crate::layout::MPTABLE_START;
+2 -5
View File
@@ -6,14 +6,11 @@
//
// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause
use std::mem;
use std::result;
use std::slice;
use std::{mem, result, slice};
use thiserror::Error;
use uuid::Uuid;
use vm_memory::ByteValued;
use vm_memory::{Address, Bytes, GuestAddress};
use vm_memory::{Address, ByteValued, Bytes, GuestAddress};
use crate::layout::SMBIOS_START;
use crate::GuestMemoryMmap;