diff options
author | David Tolnay <dtolnay@chromium.org> | 2019-04-15 15:30:21 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-04-17 17:22:57 -0700 |
commit | 1c5e2557e2eb3992c320b658ef117cb578bc6fe1 (patch) | |
tree | 03c48568332467b36db736f8d173ead442c7963e /devices/src/virtio/gpu | |
parent | 35ee9d918404ee87abdd23a450fdb483388e1932 (diff) | |
download | crosvm-1c5e2557e2eb3992c320b658ef117cb578bc6fe1.tar crosvm-1c5e2557e2eb3992c320b658ef117cb578bc6fe1.tar.gz crosvm-1c5e2557e2eb3992c320b658ef117cb578bc6fe1.tar.bz2 crosvm-1c5e2557e2eb3992c320b658ef117cb578bc6fe1.tar.lz crosvm-1c5e2557e2eb3992c320b658ef117cb578bc6fe1.tar.xz crosvm-1c5e2557e2eb3992c320b658ef117cb578bc6fe1.tar.zst crosvm-1c5e2557e2eb3992c320b658ef117cb578bc6fe1.zip |
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 <dtolnay@chromium.org> Tested-by: David Tolnay <dtolnay@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Diffstat (limited to 'devices/src/virtio/gpu')
-rw-r--r-- | devices/src/virtio/gpu/mod.rs | 8 |
1 files changed, 3 insertions, 5 deletions
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; |