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 <dverkamp@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1307816
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
This commit is contained in:
Daniel Verkamp 2018-10-30 09:24:51 -07:00 committed by chrome-bot
parent f28a864fd9
commit eeebe63c43
2 changed files with 41 additions and 51 deletions

View file

@ -1440,17 +1440,17 @@ impl Worker {
as u32; as u32;
self.in_desc_chains self.in_desc_chains
.extend(self.in_queue.iter(&self.mem).filter_map(|d| { .extend(self.in_queue.iter(&self.mem).filter_map(|d| {
if d.len >= min_in_desc_len && d.is_write_only() { if d.len >= min_in_desc_len && d.is_write_only() {
Some((d.index, d.addr, d.len)) Some((d.index, d.addr, d.len))
} else { } else {
// Can not use queue.add_used directly because it's being borrowed // Can not use queue.add_used directly because it's being borrowed
// for the iterator chain, so we buffer the descriptor index in // for the iterator chain, so we buffer the descriptor index in
// rejects. // rejects.
rejects[rejects_len] = d.index; rejects[rejects_len] = d.index;
rejects_len += 1; rejects_len += 1;
None None
} }
})); }));
for &reject in &rejects[..rejects_len] { for &reject in &rejects[..rejects_len] {
signal_used = true; signal_used = true;
self.in_queue.add_used(&self.mem, reject, 0); self.in_queue.add_used(&self.mem, reject, 0);

View file

@ -487,14 +487,12 @@ impl Vm {
/// Crates an in kernel interrupt controller. /// Crates an in kernel interrupt controller.
/// ///
/// See the documentation on the KVM_CREATE_IRQCHIP ioctl. /// See the documentation on the KVM_CREATE_IRQCHIP ioctl.
#[cfg( #[cfg(any(
any( target_arch = "x86",
target_arch = "x86", target_arch = "x86_64",
target_arch = "x86_64", target_arch = "arm",
target_arch = "arm", target_arch = "aarch64"
target_arch = "aarch64" ))]
)
)]
pub fn create_irq_chip(&self) -> Result<()> { pub fn create_irq_chip(&self) -> Result<()> {
// Safe because we know that our file is a VM fd and we verify the return 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()) }; 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. /// Sets the level on the given irq to 1 if `active` is true, and 0 otherwise.
#[cfg( #[cfg(any(
any( target_arch = "x86",
target_arch = "x86", target_arch = "x86_64",
target_arch = "x86_64", target_arch = "arm",
target_arch = "arm", target_arch = "aarch64"
target_arch = "aarch64" ))]
)
)]
pub fn set_irq_line(&self, irq: u32, active: bool) -> Result<()> { pub fn set_irq_line(&self, irq: u32, active: bool) -> Result<()> {
let mut irq_level = kvm_irq_level::default(); let mut irq_level = kvm_irq_level::default();
irq_level.__bindgen_anon_1.irq = irq; irq_level.__bindgen_anon_1.irq = irq;
@ -747,14 +743,12 @@ impl Vm {
} }
/// Registers an event that will, when signalled, trigger the `gsi` irq. /// Registers an event that will, when signalled, trigger the `gsi` irq.
#[cfg( #[cfg(any(
any( target_arch = "x86",
target_arch = "x86", target_arch = "x86_64",
target_arch = "x86_64", target_arch = "arm",
target_arch = "arm", target_arch = "aarch64"
target_arch = "aarch64" ))]
)
)]
pub fn register_irqfd(&self, evt: &EventFd, gsi: u32) -> Result<()> { pub fn register_irqfd(&self, evt: &EventFd, gsi: u32) -> Result<()> {
let irqfd = kvm_irqfd { let irqfd = kvm_irqfd {
fd: evt.as_raw_fd() as u32, 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 /// Registers an event that will, when signalled, trigger the `gsi` irq, and `resample_evt` will
/// get triggered when the irqchip is resampled. /// get triggered when the irqchip is resampled.
#[cfg( #[cfg(any(
any( target_arch = "x86",
target_arch = "x86", target_arch = "x86_64",
target_arch = "x86_64", target_arch = "arm",
target_arch = "arm", target_arch = "aarch64"
target_arch = "aarch64" ))]
)
)]
pub fn register_irqfd_resample( pub fn register_irqfd_resample(
&self, &self,
evt: &EventFd, evt: &EventFd,
@ -809,14 +801,12 @@ impl Vm {
/// ///
/// The `evt` and `gsi` pair must be the same as the ones passed into /// The `evt` and `gsi` pair must be the same as the ones passed into
/// `register_irqfd`/`register_irqfd_resample`. /// `register_irqfd`/`register_irqfd_resample`.
#[cfg( #[cfg(any(
any( target_arch = "x86",
target_arch = "x86", target_arch = "x86_64",
target_arch = "x86_64", target_arch = "arm",
target_arch = "arm", target_arch = "aarch64"
target_arch = "aarch64" ))]
)
)]
pub fn unregister_irqfd(&self, evt: &EventFd, gsi: u32) -> Result<()> { pub fn unregister_irqfd(&self, evt: &EventFd, gsi: u32) -> Result<()> {
let irqfd = kvm_irqfd { let irqfd = kvm_irqfd {
fd: evt.as_raw_fd() as u32, fd: evt.as_raw_fd() as u32,