Address clippy warnings

This commit is contained in:
topjohnwu
2023-09-06 21:45:12 -07:00
parent 4fff2aa7d8
commit 4eaf701cb7
5 changed files with 9 additions and 8 deletions

View File

@@ -60,8 +60,7 @@ fn do_extract_boot_from_payload(
return Err(bad_payload!("manifest signature length is zero"));
}
let mut buf = Vec::new();
buf.resize(manifest_len, 0u8);
let mut buf = vec![0; manifest_len];
let manifest = {
let manifest = &mut buf[..manifest_len];
@@ -171,7 +170,7 @@ fn do_extract_boot_from_payload(
if !ffi::decompress(data, out_file.as_raw_fd()) {
return Err(bad_payload!("decompression failed"));
}
},
}
_ => return Err(bad_payload!("unsupported operation type")),
};
}