kernel_loader: simplify match of empty buf

Fixes a clippy warning in Rust 1.77.

BUG=b:344974550
TEST=tools/clippy

Change-Id: I05ce1a304943e56d03544169558e5012e6c04eb8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5609080
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This commit is contained in:
Daniel Verkamp 2024-06-07 12:55:08 -07:00 committed by crosvm LUCI
parent 90a10c419e
commit 7d2280f04e

View file

@ -140,7 +140,7 @@ fn load_arm64_kernel_from_reader<F: BufRead>(
.ok_or(Error::InvalidKernelSize)?;
loop {
let buf = match kernel_image.fill_buf() {
Ok(buf) if buf.is_empty() => break,
Ok([]) => break,
Ok(buf) => buf,
Err(ref e) if e.kind() == io::ErrorKind::Interrupted => continue,
Err(_) => return Err(Error::ReadKernelImage),