Skip to content

Commit 83f7b0b

Browse files
andreeaflorescujiangliu
authored andcommitted
create irq level by using u32::from instead of if
This fixes a clippy warning. Signed-off-by: Andreea Florescu <[email protected]>
1 parent 50d03b8 commit 83f7b0b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ioctls/vm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1066,7 +1066,7 @@ impl VmFd {
10661066
pub fn set_irq_line(&self, irq: u32, active: bool) -> Result<()> {
10671067
let mut irq_level = kvm_irq_level::default();
10681068
irq_level.__bindgen_anon_1.irq = irq;
1069-
irq_level.level = if active { 1 } else { 0 };
1069+
irq_level.level = u32::from(active);
10701070

10711071
// SAFETY: Safe because we know that our file is a VM fd, we know the kernel will only read
10721072
// the correct amount of memory from our pointer, and we verify the return result.

0 commit comments

Comments
 (0)