mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vm-migration: trim qualified paths
Import the std modules used in the crate instead of spelling the full paths at every use site, and drop the now-unnecessary crate-level #![expect(clippy::absolute_paths)]. Signed-off-by: Henry Hrvoje Tonkovac <htonkovac@gmail.com> Assisted-by: Claude:Opus-4.8
This commit is contained in:
committed by
Bo Chen
parent
e9f2f14e4c
commit
c0e133bf05
@@ -3,9 +3,6 @@
|
||||
// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause
|
||||
//
|
||||
|
||||
// TODO: Trim qualified paths in this crate, then drop this expectation.
|
||||
#![expect(clippy::absolute_paths)]
|
||||
|
||||
use std::collections::BTreeMap;
|
||||
use std::{io, result};
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ use std::result;
|
||||
use std::sync::Arc;
|
||||
|
||||
use log::warn;
|
||||
use rustls::pki_types::pem::PemObject;
|
||||
use rustls::pki_types::pem::{self, PemObject};
|
||||
use rustls::pki_types::{CertificateDer, InvalidDnsNameError, PrivateKeyDer, ServerName};
|
||||
use rustls::server::{VerifierBuilderError, WebPkiClientVerifier};
|
||||
use rustls::{
|
||||
@@ -182,13 +182,13 @@ pub enum TlsError {
|
||||
RustlsVerifierBuilderError(#[source] VerifierBuilderError),
|
||||
|
||||
#[error("Rustls protocol IO error")]
|
||||
RustlsIoError(#[from] std::io::Error),
|
||||
RustlsIoError(#[from] io::Error),
|
||||
|
||||
#[error("TLS handshake stalled: no read/write progress while handshake is still in progress")]
|
||||
HandshakeError,
|
||||
|
||||
#[error("Error handling PEM file")]
|
||||
RustlsPemError(#[from] rustls::pki_types::pem::Error),
|
||||
RustlsPemError(#[from] pem::Error),
|
||||
}
|
||||
|
||||
/// Wraps the concrete rustls stream for either side (server or client) of the
|
||||
@@ -478,7 +478,7 @@ fn load_private_key(key_path: &Path) -> result::Result<PrivateKeyDer<'static>, M
|
||||
mod tests {
|
||||
use std::path::PathBuf;
|
||||
use std::time::{SystemTime, UNIX_EPOCH};
|
||||
use std::{fs, process};
|
||||
use std::{env, fs, process};
|
||||
|
||||
use super::*;
|
||||
|
||||
@@ -492,7 +492,7 @@ mod tests {
|
||||
.duration_since(UNIX_EPOCH)
|
||||
.unwrap()
|
||||
.as_nanos();
|
||||
let path = std::env::temp_dir().join(format!(
|
||||
let path = env::temp_dir().join(format!(
|
||||
"cloud-hypervisor-{name}-{}-{unique}",
|
||||
process::id()
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user