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 -2
View File
@@ -88,9 +88,8 @@ use std::time::{Duration, Instant};
use super::super::defs::uapi;
use super::super::packet::VsockPacket;
use super::super::{Result as VsockResult, VsockChannel, VsockEpollListener, VsockError};
use super::defs;
use super::txbuf::TxBuf;
use super::{ConnState, Error, PendingRx, PendingRxSet, Result};
use super::{defs, ConnState, Error, PendingRx, PendingRxSet, Result};
/// A self-managing connection object, that handles communication between a guest-side AF_VSOCK
/// socket and a host-side `Read + Write + AsRawFd` stream.
+2 -5
View File
@@ -5,8 +5,7 @@
use std::io::Write;
use std::num::Wrapping;
use super::defs;
use super::{Error, Result};
use super::{defs, Error, Result};
/// A simple ring-buffer implementation, used by vsock connections to buffer TX (guest -> host)
/// data. Memory for this buffer is allocated lazily, since buffering will only be needed when
@@ -144,9 +143,7 @@ impl TxBuf {
#[cfg(test)]
mod tests {
use std::io::Error as IoError;
use std::io::ErrorKind;
use std::io::Result as IoResult;
use std::io::{Error as IoError, ErrorKind, Result as IoResult};
use super::*;