diff --git a/base/src/sys/unix/panic_handler.rs b/base/src/sys/unix/panic_handler.rs index b831dcc129..bad17808e8 100644 --- a/base/src/sys/unix/panic_handler.rs +++ b/base/src/sys/unix/panic_handler.rs @@ -4,12 +4,13 @@ //! A panic handler for better crash signatures for rust apps. -use super::SharedMemory; use std::ffi::CString; use std::io; use std::mem; use std::panic; +use super::SharedMemory; + const PANIC_MEMFD_NAME: &str = "RUST_PANIC_SIG"; /// Inserts a panic handler that writes the panic info to a memfd called diff --git a/base/src/sys/unix/stream_channel.rs b/base/src/sys/unix/stream_channel.rs index 4f90c41ddd..12579795c0 100644 --- a/base/src/sys/unix/stream_channel.rs +++ b/base/src/sys/unix/stream_channel.rs @@ -10,7 +10,6 @@ use std::os::unix::net::UnixStream; use std::time::Duration; use libc::c_void; - use serde::Deserialize; use serde::Serialize; diff --git a/base/src/syslog.rs b/base/src/syslog.rs index f685bc9213..74c5fc91bd 100644 --- a/base/src/syslog.rs +++ b/base/src/syslog.rs @@ -49,7 +49,6 @@ //! //! [log-crate-url]: https://docs.rs/log/ -use once_cell::sync::Lazy; use std::fmt::Display; use std::io; use std::io::Write; @@ -59,6 +58,7 @@ use chrono::Local; pub use env_logger::fmt; pub use env_logger::{self}; pub use log::*; +use once_cell::sync::Lazy; use once_cell::sync::OnceCell; use remain::sorted; use serde::Deserialize; diff --git a/devices/src/acpi.rs b/devices/src/acpi.rs index c23291f773..1c061f0715 100644 --- a/devices/src/acpi.rs +++ b/devices/src/acpi.rs @@ -23,7 +23,8 @@ use base::EventToken; use base::SendTube; use base::VmEventType; use base::WaitContext; -use serde::{Deserialize, Serialize}; +use serde::Deserialize; +use serde::Serialize; use sync::Mutex; use thiserror::Error; use vm_control::GpeNotify; diff --git a/src/crosvm/sys/unix/config.rs b/src/crosvm/sys/unix/config.rs index 0a0cc225ec..2e4f817b49 100644 --- a/src/crosvm/sys/unix/config.rs +++ b/src/crosvm/sys/unix/config.rs @@ -6,10 +6,12 @@ use std::collections::BTreeMap; use std::path::PathBuf; use std::str::FromStr; +#[cfg(feature = "gpu")] +use devices::virtio::GpuDisplayParameters; #[cfg(feature = "gfxstream")] use devices::virtio::GpuMode; #[cfg(feature = "gpu")] -use devices::virtio::{GpuDisplayParameters, GpuParameters}; +use devices::virtio::GpuParameters; use devices::IommuDevType; use devices::PciAddress; use devices::SerialParameters; @@ -349,9 +351,10 @@ mod tests { #[test] fn parse_coiommu_options() { + use std::time::Duration; + use devices::CoIommuParameters; use devices::CoIommuUnpinPolicy; - use std::time::Duration; // unpin_policy let coiommu_params = from_key_values::("unpin_policy=off").unwrap(); diff --git a/tools/audio_streams_conformance_test/src/args.rs b/tools/audio_streams_conformance_test/src/args.rs index f503d21a85..62fe90ff0d 100644 --- a/tools/audio_streams_conformance_test/src/args.rs +++ b/tools/audio_streams_conformance_test/src/args.rs @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -use std::{fmt, str::FromStr}; +use std::fmt; +use std::str::FromStr; use argh::FromArgs; use audio_streams::*; diff --git a/tools/audio_streams_conformance_test/src/error.rs b/tools/audio_streams_conformance_test/src/error.rs index 512b949b1f..3eb9ca6e91 100644 --- a/tools/audio_streams_conformance_test/src/error.rs +++ b/tools/audio_streams_conformance_test/src/error.rs @@ -2,9 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +use std::io; + use audio_streams::BoxError; use remain::sorted; -use std::io; use thiserror::Error; pub type Result = std::result::Result; diff --git a/tools/audio_streams_conformance_test/src/main.rs b/tools/audio_streams_conformance_test/src/main.rs index aabbdd611b..c0e92e1124 100644 --- a/tools/audio_streams_conformance_test/src/main.rs +++ b/tools/audio_streams_conformance_test/src/main.rs @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -use std::{io, time::Instant}; +use std::io; +use std::time::Instant; use audio_streams::*; use cros_async::Executor; @@ -11,11 +12,10 @@ mod args; mod error; mod performance_data; -use crate::{ - args::*, - error::{Error, Result}, - performance_data::*, -}; +use crate::args::*; +use crate::error::Error; +use crate::error::Result; +use crate::performance_data::*; async fn run_playback(ex: &Executor, args: &Args) -> Result { let mut data = PerformanceData::default(); diff --git a/tools/audio_streams_conformance_test/src/performance_data.rs b/tools/audio_streams_conformance_test/src/performance_data.rs index fab43b0a94..7f2a16ba0c 100644 --- a/tools/audio_streams_conformance_test/src/performance_data.rs +++ b/tools/audio_streams_conformance_test/src/performance_data.rs @@ -2,12 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -use std::{fmt, time::Duration}; +use std::fmt; +use std::time::Duration; use num::integer::Roots; use serde::Serialize; -use crate::{args::Args, error::*}; +use crate::args::Args; +use crate::error::*; const NANOS_PER_MICROS: f32 = 1_000_000.0;