Skip to content

build.rs: fix println #850

build.rs: fix println

build.rs: fix println #850

GitHub Actions / clippy kvm failed Feb 20, 2024 in 0s

clippy kvm

4 errors

Details

Results

Message level Amount
Internal compiler error 0
Error 4
Warning 0
Note 0
Help 0

Versions

  • rustc 1.76.0 (07dca489a 2024-02-04)
  • cargo 1.76.0 (c84b36747 2024-01-18)
  • clippy 0.1.76 (07dca48 2024-02-04)

Annotations

Check failure on line 347 in src/driver/kvm.rs

See this annotation in the file changed.

@github-actions github-actions / clippy kvm

replacing an `Option` with `None`

error: replacing an `Option` with `None`
   --> src/driver/kvm.rs:347:26
    |
347 |         let kvmi_event = mem::replace(&mut self.vec_events[vcpu_index], None).unwrap();
    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `self.vec_events[vcpu_index].take()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_option_with_none
    = note: `-D clippy::mem-replace-option-with-none` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::mem_replace_option_with_none)]`

Check failure on line 346 in src/driver/kvm.rs

See this annotation in the file changed.

@github-actions github-actions / clippy kvm

use of a fallible conversion when an infallible one could be used

error: use of a fallible conversion when an infallible one could be used
   --> src/driver/kvm.rs:346:44
    |
346 |         let vcpu_index: usize = event.vcpu.try_into()?;
    |                                            ^^^^^^^^ help: use: `into`
    |
    = note: converting `u16` to `usize` cannot fail
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions

Check failure on line 326 in src/driver/kvm.rs

See this annotation in the file changed.

@github-actions github-actions / clippy kvm

use of a fallible conversion when an infallible one could be used

error: use of a fallible conversion when an infallible one could be used
   --> src/driver/kvm.rs:326:46
    |
326 |                 let vcpu_index: usize = vcpu.try_into()?;
    |                                              ^^^^^^^^ help: use: `into`
    |
    = note: converting `u16` to `usize` cannot fail
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions

Check failure on line 133 in src/driver/kvm.rs

See this annotation in the file changed.

@github-actions github-actions / clippy kvm

use of a fallible conversion when an infallible one could be used

error: use of a fallible conversion when an infallible one could be used
   --> src/driver/kvm.rs:133:47
    |
133 |         kvm.vec_events.resize_with(vcpu_count.try_into()?, || None);
    |                                               ^^^^^^^^ help: use: `into`
    |
    = note: converting `u16` to `usize` cannot fail
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions
    = note: `-D clippy::unnecessary-fallible-conversions` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::unnecessary_fallible_conversions)]`