summary refs log tree commit diff
path: root/x86_64
diff options
context:
space:
mode:
authorDaniel Verkamp <dverkamp@chromium.org>2019-05-17 15:36:27 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-05-22 20:57:04 -0700
commit03b238bcc09ff386650c54708a3b8bf713a058b2 (patch)
tree4b8c05cb5f3ee199ef6570d48820d41af0241988 /x86_64
parent9c9e0e71bd0ecf770fca66320a4b3b8a0b329bd4 (diff)
downloadcrosvm-03b238bcc09ff386650c54708a3b8bf713a058b2.tar
crosvm-03b238bcc09ff386650c54708a3b8bf713a058b2.tar.gz
crosvm-03b238bcc09ff386650c54708a3b8bf713a058b2.tar.bz2
crosvm-03b238bcc09ff386650c54708a3b8bf713a058b2.tar.lz
crosvm-03b238bcc09ff386650c54708a3b8bf713a058b2.tar.xz
crosvm-03b238bcc09ff386650c54708a3b8bf713a058b2.tar.zst
crosvm-03b238bcc09ff386650c54708a3b8bf713a058b2.zip
smbios: fix clippy warnings
Resolve a couple of minor clippy warnings:
- const implies static lifetime, so it can be omitted
- dereference bytes of str instead of clone()

BUG=None
TEST=bin/clippy
TEST=cargo build; boot vm_kernel+vm_rootfs.img

Change-Id: I29ff9bf7fdecd64286c2199e8e45c21103de9ce1
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1618284
Tested-by: kokoro <noreply+kokoro@google.com>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Diffstat (limited to 'x86_64')
-rw-r--r--x86_64/src/smbios.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/x86_64/src/smbios.rs b/x86_64/src/smbios.rs
index 491ad4a..0ae3851 100644
--- a/x86_64/src/smbios.rs
+++ b/x86_64/src/smbios.rs
@@ -47,7 +47,7 @@ pub type Result<T> = result::Result<T, Error>;
 const SMBIOS_START: u64 = 0xf0000; // First possible location per the spec.
 
 // Constants sourced from SMBIOS Spec 3.2.0.
-const SM3_MAGIC_IDENT: &'static [u8; 5usize] = b"_SM3_";
+const SM3_MAGIC_IDENT: &[u8; 5usize] = b"_SM3_";
 const BIOS_INFORMATION: u8 = 0;
 const SYSTEM_INFORMATION: u8 = 1;
 const PCI_SUPPORTED: u64 = 1 << 7;
@@ -148,7 +148,7 @@ fn write_and_incr<T: DataInit>(
 
 fn write_string(mem: &GuestMemory, val: &str, mut curptr: GuestAddress) -> Result<GuestAddress> {
     for c in val.as_bytes().iter() {
-        curptr = write_and_incr(mem, c.clone(), curptr)?;
+        curptr = write_and_incr(mem, *c, curptr)?;
     }
     curptr = write_and_incr(mem, 0 as u8, curptr)?;
     Ok(curptr)