From eeebe63c43482ee6a52b9ff480724f2ae60db821 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Tue, 30 Oct 2018 09:24:51 -0700 Subject: [PATCH] cargo fmt with Rust 1.30.0 Rust 1.30.0 ships a new rustfmt that causes a few more formatting changes. BUG=None TEST=Run kokoro tests with updated Rust version Change-Id: I803765ec0f3d2447f627b1e990bce438512367f7 Signed-off-by: Daniel Verkamp Reviewed-on: https://chromium-review.googlesource.com/1307816 Commit-Ready: ChromeOS CL Exonerator Bot Reviewed-by: Zach Reizner Reviewed-by: Dylan Reid --- devices/src/virtio/wl.rs | 22 ++++++------- kvm/src/lib.rs | 70 +++++++++++++++++----------------------- 2 files changed, 41 insertions(+), 51 deletions(-) diff --git a/devices/src/virtio/wl.rs b/devices/src/virtio/wl.rs index 1933be5331..0b973bdec4 100644 --- a/devices/src/virtio/wl.rs +++ b/devices/src/virtio/wl.rs @@ -1440,17 +1440,17 @@ impl Worker { as u32; self.in_desc_chains .extend(self.in_queue.iter(&self.mem).filter_map(|d| { - if d.len >= min_in_desc_len && d.is_write_only() { - Some((d.index, d.addr, d.len)) - } else { - // Can not use queue.add_used directly because it's being borrowed - // for the iterator chain, so we buffer the descriptor index in - // rejects. - rejects[rejects_len] = d.index; - rejects_len += 1; - None - } - })); + if d.len >= min_in_desc_len && d.is_write_only() { + Some((d.index, d.addr, d.len)) + } else { + // Can not use queue.add_used directly because it's being borrowed + // for the iterator chain, so we buffer the descriptor index in + // rejects. + rejects[rejects_len] = d.index; + rejects_len += 1; + None + } + })); for &reject in &rejects[..rejects_len] { signal_used = true; self.in_queue.add_used(&self.mem, reject, 0); diff --git a/kvm/src/lib.rs b/kvm/src/lib.rs index f9188e0e3a..050e1cd092 100644 --- a/kvm/src/lib.rs +++ b/kvm/src/lib.rs @@ -487,14 +487,12 @@ impl Vm { /// Crates an in kernel interrupt controller. /// /// See the documentation on the KVM_CREATE_IRQCHIP ioctl. - #[cfg( - any( - target_arch = "x86", - target_arch = "x86_64", - target_arch = "arm", - target_arch = "aarch64" - ) - )] + #[cfg(any( + target_arch = "x86", + target_arch = "x86_64", + target_arch = "arm", + target_arch = "aarch64" + ))] pub fn create_irq_chip(&self) -> Result<()> { // Safe because we know that our file is a VM fd and we verify the return result. let ret = unsafe { ioctl(self, KVM_CREATE_IRQCHIP()) }; @@ -588,14 +586,12 @@ impl Vm { } /// Sets the level on the given irq to 1 if `active` is true, and 0 otherwise. - #[cfg( - any( - target_arch = "x86", - target_arch = "x86_64", - target_arch = "arm", - target_arch = "aarch64" - ) - )] + #[cfg(any( + target_arch = "x86", + target_arch = "x86_64", + target_arch = "arm", + target_arch = "aarch64" + ))] pub fn set_irq_line(&self, irq: u32, active: bool) -> Result<()> { let mut irq_level = kvm_irq_level::default(); irq_level.__bindgen_anon_1.irq = irq; @@ -747,14 +743,12 @@ impl Vm { } /// Registers an event that will, when signalled, trigger the `gsi` irq. - #[cfg( - any( - target_arch = "x86", - target_arch = "x86_64", - target_arch = "arm", - target_arch = "aarch64" - ) - )] + #[cfg(any( + target_arch = "x86", + target_arch = "x86_64", + target_arch = "arm", + target_arch = "aarch64" + ))] pub fn register_irqfd(&self, evt: &EventFd, gsi: u32) -> Result<()> { let irqfd = kvm_irqfd { fd: evt.as_raw_fd() as u32, @@ -773,14 +767,12 @@ impl Vm { /// Registers an event that will, when signalled, trigger the `gsi` irq, and `resample_evt` will /// get triggered when the irqchip is resampled. - #[cfg( - any( - target_arch = "x86", - target_arch = "x86_64", - target_arch = "arm", - target_arch = "aarch64" - ) - )] + #[cfg(any( + target_arch = "x86", + target_arch = "x86_64", + target_arch = "arm", + target_arch = "aarch64" + ))] pub fn register_irqfd_resample( &self, evt: &EventFd, @@ -809,14 +801,12 @@ impl Vm { /// /// The `evt` and `gsi` pair must be the same as the ones passed into /// `register_irqfd`/`register_irqfd_resample`. - #[cfg( - any( - target_arch = "x86", - target_arch = "x86_64", - target_arch = "arm", - target_arch = "aarch64" - ) - )] + #[cfg(any( + target_arch = "x86", + target_arch = "x86_64", + target_arch = "arm", + target_arch = "aarch64" + ))] pub fn unregister_irqfd(&self, evt: &EventFd, gsi: u32) -> Result<()> { let irqfd = kvm_irqfd { fd: evt.as_raw_fd() as u32,