From 1c5e2557e2eb3992c320b658ef117cb578bc6fe1 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Mon, 15 Apr 2019 15:30:21 -0700 Subject: edition: Eliminate blocks superseded by NLL Before the new borrow checker in the 2018 edition, we sometimes used to have to manually insert curly braced blocks to limit the scope of borrows. These are no longer needed. Details in: https://doc.rust-lang.org/edition-guide/rust-2018/ownership-and-lifetimes/non-lexical-lifetimes.html TEST=cargo check --all-features TEST=local kokoro Change-Id: I59f9f98dcc03c8790c53e080a527ad9b68c8d6f3 Reviewed-on: https://chromium-review.googlesource.com/1568075 Commit-Ready: David Tolnay Tested-by: David Tolnay Tested-by: kokoro Reviewed-by: Daniel Verkamp --- devices/src/virtio/gpu/mod.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'devices/src/virtio/gpu') diff --git a/devices/src/virtio/gpu/mod.rs b/devices/src/virtio/gpu/mod.rs index 686c174..2c13acc 100644 --- a/devices/src/virtio/gpu/mod.rs +++ b/devices/src/virtio/gpu/mod.rs @@ -690,11 +690,9 @@ impl VirtioDevice for Gpu { let offset = offset as usize; let len = data.len(); let mut cfg = self.get_config(); - { - let cfg_slice = cfg.as_mut_slice(); - if offset + len <= cfg_slice.len() { - cfg_slice[offset..offset + len].copy_from_slice(data); - } + let cfg_slice = cfg.as_mut_slice(); + if offset + len <= cfg_slice.len() { + cfg_slice[offset..offset + len].copy_from_slice(data); } if (cfg.events_clear.to_native() & VIRTIO_GPU_EVENT_DISPLAY) != 0 { self.config_event = false; -- cgit 1.4.1