Skip to content

Commit 458483a

Browse files
committed
chore(rust): Fix clippy warnings introduced in Rust 1.95.0
As usual, the new clippy version found new things to complain about. Fix them to keep it happy. Signed-off-by: Ilias Stamatis <ilstam@amazon.com>
1 parent ee9214b commit 458483a

3 files changed

Lines changed: 4 additions & 6 deletions

File tree

src/cpu-template-helper/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ fn run(cli: Cli) -> Result<(), HelperError> {
146146

147147
let stripped_templates = template::strip::strip(templates)?;
148148

149-
for (path, template) in paths.into_iter().zip(stripped_templates.into_iter()) {
149+
for (path, template) in paths.into_iter().zip(stripped_templates) {
150150
let path = utils::add_suffix(&path, &suffix);
151151
let template_json = serde_json::to_string_pretty(&template)?;
152152
write(path, template_json)?;

src/vmm/src/devices/virtio/block/virtio/request.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,10 +308,8 @@ impl Request {
308308
return Err(VirtioBlockError::InvalidOffset);
309309
}
310310
}
311-
RequestType::GetDeviceID => {
312-
if req.data_len < VIRTIO_BLK_ID_BYTES {
313-
return Err(VirtioBlockError::InvalidDataLength);
314-
}
311+
RequestType::GetDeviceID if req.data_len < VIRTIO_BLK_ID_BYTES => {
312+
return Err(VirtioBlockError::InvalidDataLength);
315313
}
316314
_ => {}
317315
}

src/vmm/src/gdb/target.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ impl MultiThreadBase for FirecrackerTarget {
416416

417417
vmm.vm
418418
.guest_memory()
419-
.read(&mut data[..read_len], GuestAddress(gpa as u64))
419+
.read(&mut data[..read_len], GuestAddress(gpa))
420420
.map_err(|e| {
421421
error!("Error reading memory {e:?} gpa is {gpa}");
422422
})?;

0 commit comments

Comments
 (0)