From 03b238bcc09ff386650c54708a3b8bf713a058b2 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Fri, 17 May 2019 15:36:27 -0700 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/1618284 Tested-by: kokoro Legacy-Commit-Queue: Commit Bot Reviewed-by: Dylan Reid --- x86_64/src/smbios.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'x86_64') 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 = result::Result; 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( fn write_string(mem: &GuestMemory, val: &str, mut curptr: GuestAddress) -> Result { 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) -- cgit 1.4.1