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:
Henry Hrvoje Tonkovac
2026-06-17 16:58:07 +02:00
committed by Bo Chen
parent e9f2f14e4c
commit c0e133bf05
2 changed files with 5 additions and 8 deletions

View File

@@ -3,9 +3,6 @@
// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause // 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::collections::BTreeMap;
use std::{io, result}; use std::{io, result};

View File

@@ -27,7 +27,7 @@ use std::result;
use std::sync::Arc; use std::sync::Arc;
use log::warn; 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::pki_types::{CertificateDer, InvalidDnsNameError, PrivateKeyDer, ServerName};
use rustls::server::{VerifierBuilderError, WebPkiClientVerifier}; use rustls::server::{VerifierBuilderError, WebPkiClientVerifier};
use rustls::{ use rustls::{
@@ -182,13 +182,13 @@ pub enum TlsError {
RustlsVerifierBuilderError(#[source] VerifierBuilderError), RustlsVerifierBuilderError(#[source] VerifierBuilderError),
#[error("Rustls protocol IO error")] #[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")] #[error("TLS handshake stalled: no read/write progress while handshake is still in progress")]
HandshakeError, HandshakeError,
#[error("Error handling PEM file")] #[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 /// 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 { mod tests {
use std::path::PathBuf; use std::path::PathBuf;
use std::time::{SystemTime, UNIX_EPOCH}; use std::time::{SystemTime, UNIX_EPOCH};
use std::{fs, process}; use std::{env, fs, process};
use super::*; use super::*;
@@ -492,7 +492,7 @@ mod tests {
.duration_since(UNIX_EPOCH) .duration_since(UNIX_EPOCH)
.unwrap() .unwrap()
.as_nanos(); .as_nanos();
let path = std::env::temp_dir().join(format!( let path = env::temp_dir().join(format!(
"cloud-hypervisor-{name}-{}-{unique}", "cloud-hypervisor-{name}-{}-{unique}",
process::id() process::id()
)); ));