tree-wide: reformat with nightly rustfmt

BUG=None
TEST=tools/fmt --nightly

Change-Id: I9e1985546b364835e252df04dab2c9ecb192047c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3852316
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
This commit is contained in:
Daniel Verkamp 2022-08-23 15:48:12 -07:00 committed by crosvm LUCI
parent b2011fd697
commit bf449563d8
9 changed files with 24 additions and 16 deletions

View file

@ -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

View file

@ -10,7 +10,6 @@ use std::os::unix::net::UnixStream;
use std::time::Duration;
use libc::c_void;
use serde::Deserialize;
use serde::Serialize;

View file

@ -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;

View file

@ -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;

View file

@ -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::<CoIommuParameters>("unpin_policy=off").unwrap();

View file

@ -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::*;

View file

@ -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<T> = std::result::Result<T, Error>;

View file

@ -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<PerformanceData> {
let mut data = PerformanceData::default();

View file

@ -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;