mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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:
@@ -6,11 +6,9 @@
|
||||
|
||||
use core::panic::AssertUnwindSafe;
|
||||
use std::fs::File;
|
||||
use std::io;
|
||||
use std::os::unix::io::{AsRawFd, FromRawFd, RawFd};
|
||||
use std::result;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::thread;
|
||||
use std::{io, result, thread};
|
||||
|
||||
use thiserror::Error;
|
||||
use vmm_sys_util::eventfd::EventFd;
|
||||
@@ -300,12 +298,15 @@ impl Drop for RateLimiterGroup {
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) mod tests {
|
||||
use std::{os::fd::AsRawFd, thread, time::Duration};
|
||||
use std::os::fd::AsRawFd;
|
||||
use std::thread;
|
||||
use std::time::Duration;
|
||||
|
||||
use vmm_sys_util::eventfd::EventFd;
|
||||
|
||||
use super::RateLimiterGroupHandle;
|
||||
use crate::{group::RateLimiterGroup, TokenBucket, TokenType, REFILL_TIMER_INTERVAL_MS};
|
||||
use crate::group::RateLimiterGroup;
|
||||
use crate::{TokenBucket, TokenType, REFILL_TIMER_INTERVAL_MS};
|
||||
|
||||
impl RateLimiterGroupHandle {
|
||||
pub fn bandwidth(&self) -> Option<TokenBucket> {
|
||||
|
||||
@@ -520,8 +520,7 @@ impl Default for RateLimiter {
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) mod tests {
|
||||
use std::fmt;
|
||||
use std::thread;
|
||||
use std::{fmt, thread};
|
||||
|
||||
use super::*;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user