tree-wide: apply cargo fmt --nightly

Fix a few recently introduced formatting mismatches.

Change-Id: I1617683532d3cc45f67ec15408fbd4ec4c9d6bb2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3928132
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
This commit is contained in:
Daniel Verkamp 2022-10-03 12:08:17 -07:00 committed by crosvm LUCI
parent b83b553ff5
commit f29a992754
14 changed files with 34 additions and 24 deletions

View file

@ -6,13 +6,14 @@
#[cfg(fuzzing)]
mod fs_server_fuzzer {
use std::convert::TryInto;
use cros_fuzz::fuzz_target;
use devices::virtio::create_descriptor_chain;
use devices::virtio::DescriptorType;
use devices::virtio::Reader;
use devices::virtio::Writer;
use fuse::fuzzing::fuzz_server;
use std::convert::TryInto;
use vm_memory::GuestAddress;
use vm_memory::GuestMemory;

View file

@ -4,13 +4,14 @@
#![no_main]
use std::mem::size_of;
use cros_fuzz::fuzz_target;
use cros_fuzz::rand::FuzzRng;
use devices::virtio::DescriptorChain;
use devices::virtio::Queue;
use rand::Rng;
use rand::RngCore;
use std::mem::size_of;
use vm_memory::GuestAddress;
use vm_memory::GuestMemory;

View file

@ -4,9 +4,10 @@
#![no_main]
use cros_fuzz::fuzz_target;
use std::fs::File;
use std::io::Write;
use cros_fuzz::fuzz_target;
use vm_memory::GuestAddress;
use vm_memory::GuestMemory;

View file

@ -316,9 +316,10 @@ impl StreamInfo {
#[cfg(test)]
mod tests {
use super::*;
use audio_streams::NoopStreamSourceGenerator;
use super::*;
fn new_stream() -> StreamInfo {
StreamInfo::new(Box::new(NoopStreamSourceGenerator::new()))
}

View file

@ -872,6 +872,7 @@ mod tests {
#[test]
fn test_vhost_user_activate() {
use std::os::unix::net::UnixStream;
use vmm_vhost::connection::socket::Listener as SocketListener;
use vmm_vhost::SlaveListener;

View file

@ -268,6 +268,7 @@ mod tests {
#[test]
fn test_vhost_user_activate() {
use std::os::unix::net::UnixStream;
use vmm_vhost::connection::socket::Listener as SocketListener;
use vmm_vhost::SlaveListener;

View file

@ -2,13 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use anyhow::Context;
use futures::pin_mut;
use futures::select;
use futures::FutureExt;
use std::sync::Arc;
use std::sync::Mutex;
use anyhow::Context;
use anyhow::Result;
use base::info;
use base::CloseNotifier;
@ -16,6 +13,9 @@ use base::ReadNotifier;
use base::Tube;
use cros_async::EventAsync;
use cros_async::Executor;
use futures::pin_mut;
use futures::select;
use futures::FutureExt;
use vmm_vhost::connection::TubeEndpoint;
use vmm_vhost::message::MasterReq;
use vmm_vhost::message::VhostUserProtocolFeatures;

View file

@ -11,7 +11,6 @@ use std::sync::Weak;
use anyhow::anyhow;
use anyhow::Context;
use base::error;
use base::AsRawDescriptor;
use base::MappedRegion;

View file

@ -3,9 +3,8 @@
// found in the LICENSE file.
use std::error::Error;
use std::fmt::{Display, Formatter};
use thiserror::Error as ThisError;
use std::fmt::Display;
use std::fmt::Formatter;
use base::MappedRegion;
use base::MemoryMappingArena;
@ -18,6 +17,7 @@ use ffmpeg::avcodec::AvFrameError;
use ffmpeg::avcodec::AvPixelFormat;
use ffmpeg::avcodec::Dimensions;
use ffmpeg::avcodec::PlaneDescriptor;
use thiserror::Error as ThisError;
use crate::virtio::video::format::Format;
use crate::virtio::video::resource::BufferHandle;

View file

@ -341,10 +341,12 @@ impl BusDevice for Vmwdt {
}
#[cfg(test)]
mod tests {
use super::*;
use base::Tube;
use std::thread::sleep;
use base::Tube;
use super::*;
const AARCH64_VMWDT_ADDR: u64 = 0x3000;
const TEST_VMWDT_CPU_NO: usize = 0x1;

View file

@ -14,14 +14,19 @@
//
// Instantiating a CrasClient using this will always panic!
use audio_streams::{
shm_streams::{SharedMemory, ShmStream, ShmStreamSource},
BoxError, SampleFormat, StreamDirection, StreamEffect, StreamSource, StreamSourceGenerator,
};
use std::error;
use std::fmt;
use std::str::FromStr;
use audio_streams::shm_streams::SharedMemory;
use audio_streams::shm_streams::ShmStream;
use audio_streams::shm_streams::ShmStreamSource;
use audio_streams::BoxError;
use audio_streams::SampleFormat;
use audio_streams::StreamDirection;
use audio_streams::StreamEffect;
use audio_streams::StreamSource;
use audio_streams::StreamSourceGenerator;
use serde::Deserialize;
use serde::Deserializer;
use serde::Serialize;

View file

@ -18,9 +18,8 @@ use libc::c_int;
use libc::c_void;
use thiserror::Error as ThisError;
use crate::ffi::AVPictureType;
use super::*;
use crate::ffi::AVPictureType;
/// An error returned by a low-level libavcodec function.
#[derive(Debug, ThisError)]

View file

@ -14,6 +14,7 @@ pub mod swscale;
pub use ffi::AVPictureType_AV_PICTURE_TYPE_I;
pub use ffi::AVPixelFormat_AV_PIX_FMT_NV12;
pub use ffi::AVPixelFormat_AV_PIX_FMT_YUV420P;
pub use ffi::AVRational;
pub use ffi::AV_CODEC_CAP_DR1;
pub use ffi::AV_PKT_FLAG_KEY;
pub use ffi::FF_PROFILE_H264_BASELINE;
@ -32,5 +33,3 @@ pub use ffi::FF_PROFILE_VP9_0;
pub use ffi::FF_PROFILE_VP9_1;
pub use ffi::FF_PROFILE_VP9_2;
pub use ffi::FF_PROFILE_VP9_3;
pub use ffi::AVRational;

View file

@ -93,10 +93,10 @@ pub unsafe fn unpack(descriptor: SafeDescriptor) -> PackedTubeResult<Tube> {
#[cfg(test)]
mod tests {
use crate::packed_tube;
use base::Tube;
use crate::packed_tube;
#[test]
/// Tests packing and unpacking.
fn test_pack_unpack() {