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>
This commit is contained in:
Daniel Verkamp 2019-05-17 15:36:27 -07:00 committed by chrome-bot
parent 9c9e0e71bd
commit 03b238bcc0

View file

@ -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)