Skip to content

update memcached

update memcached #1541

GitHub Actions / clippy succeeded Dec 7, 2023 in 3s

clippy

214 warnings

Details

Results

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

Versions

  • rustc 1.67.0-nightly (a28f3c88e 2022-11-20)
  • cargo 1.67.0-nightly (eb5d35917 2022-11-17)
  • clippy 0.1.66 (a28f3c8 2022-11-20)

Annotations

Check warning on line 67 in lib/vmxnet3/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

clamp-like pattern without using clamp function

warning: clamp-like pattern without using clamp function
  --> lib/vmxnet3/src/lib.rs:67:30
   |
67 |         *self = BoundedUSize(n.min(Self::HIGH).max(Self::LOW))
   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `n.clamp(Self::LOW, Self::HIGH)`
   |
   = note: clamp will panic if max < min
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp

Check warning on line 55 in lib/vmxnet3/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

clamp-like pattern without using clamp function

warning: clamp-like pattern without using clamp function
  --> lib/vmxnet3/src/lib.rs:55:22
   |
55 |         BoundedUSize(n.min(Self::HIGH).max(Self::LOW))
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `n.clamp(Self::LOW, Self::HIGH)`
   |
   = note: clamp will panic if max < min
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp

Check warning on line 35 in lib/vmxnet3/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

clamp-like pattern without using clamp function

warning: clamp-like pattern without using clamp function
  --> lib/vmxnet3/src/lib.rs:35:28
   |
35 |         *self = BoundedU32(n.min(Self::HIGH).max(Self::LOW))
   |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `n.clamp(Self::LOW, Self::HIGH)`
   |
   = note: clamp will panic if max < min
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp

Check warning on line 23 in lib/vmxnet3/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

clamp-like pattern without using clamp function

warning: clamp-like pattern without using clamp function
  --> lib/vmxnet3/src/lib.rs:23:20
   |
23 |         BoundedU32(n.min(Self::HIGH).max(Self::LOW))
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `n.clamp(Self::LOW, Self::HIGH)`
   |
   = note: clamp will panic if max < min
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp
   = note: `#[warn(clippy::manual_clamp)]` on by default

Check warning on line 376 in lib/vmxnet3/src/vmx.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

casting to the same type is unnecessary (`u32` -> `u32`)

warning: casting to the same type is unnecessary (`u32` -> `u32`)
   --> lib/vmxnet3/src/vmx.rs:376:48
    |
376 |         self.pci.write_bar1(VMXNET3_BAR1_MACH, mh as u32);
    |                                                ^^^^^^^^^ help: try: `mh`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

Check warning on line 373 in lib/vmxnet3/src/vmx.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

casting to the same type is unnecessary (`u32` -> `u32`)

warning: casting to the same type is unnecessary (`u32` -> `u32`)
   --> lib/vmxnet3/src/vmx.rs:373:48
    |
373 |         self.pci.write_bar1(VMXNET3_BAR1_MACL, ml as u32);
    |                                                ^^^^^^^^^ help: try: `ml`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

Check warning on line 352 in lib/vmxnet3/src/vmx.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this operation has no effect

warning: this operation has no effect
   --> lib/vmxnet3/src/vmx.rs:352:26
    |
352 |         self.lladdr[4] = (high >> 0) as u8;
    |                          ^^^^^^^^^^^ help: consider reducing it to: `high`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op

Check warning on line 348 in lib/vmxnet3/src/vmx.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this operation has no effect

warning: this operation has no effect
   --> lib/vmxnet3/src/vmx.rs:348:26
    |
348 |         self.lladdr[0] = (low >> 0) as u8;
    |                          ^^^^^^^^^^ help: consider reducing it to: `low`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op

Check warning on line 283 in lib/vmxnet3/src/vmx.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

length comparison to zero

warning: length comparison to zero
   --> lib/vmxnet3/src/vmx.rs:283:12
    |
283 |         if self.rxq.len() > 0 {
    |            ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.rxq.is_empty()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
    = note: `#[warn(clippy::len_zero)]` on by default

Check warning on line 651 in lib/vmxnet3/src/var.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the variable `i` is used as a loop counter

warning: the variable `i` is used as a loop counter
   --> lib/vmxnet3/src/var.rs:651:9
    |
651 |         for chain in chain.segments.iter() {
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (i, chain) in chain.segments.iter().enumerate()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop
    = note: `#[warn(clippy::explicit_counter_loop)]` on by default

Check warning on line 597 in lib/vmxnet3/src/var.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
   --> lib/vmxnet3/src/var.rs:597:13
    |
597 |             return self.pidx_tail0 - self.pidx_head0;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
    = help: remove `return`

Check warning on line 595 in lib/vmxnet3/src/var.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
   --> lib/vmxnet3/src/var.rs:595:13
    |
595 |             return self.pidx_head0 - self.pidx_tail0;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
    = note: `#[warn(clippy::needless_return)]` on by default
    = help: remove `return`

Check warning on line 583 in lib/vmxnet3/src/var.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this operation has no effect

warning: this operation has no effect
   --> lib/vmxnet3/src/var.rs:583:55
    |
583 |             vxrxq_comp_ring: vmxnet3_rxcomp_ring::new(1 * ndesc)?,
    |                                                       ^^^^^^^^^ help: consider reducing it to: `ndesc`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op
    = note: `#[warn(clippy::identity_op)]` on by default

Check warning on line 498 in lib/vmxnet3/src/var.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

casting to the same type is unnecessary (`usize` -> `usize`)

warning: casting to the same type is unnecessary (`usize` -> `usize`)
   --> lib/vmxnet3/src/var.rs:498:33
    |
498 |             let txcd = txc.vxcr[txc.vxcr_next as usize];
    |                                 ^^^^^^^^^^^^^^^^^^^^^^ help: try: `txc.vxcr_next`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

Check warning on line 405 in lib/vmxnet3/src/var.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

casting to the same type is unnecessary (`u32` -> `u32`)

warning: casting to the same type is unnecessary (`u32` -> `u32`)
   --> lib/vmxnet3/src/var.rs:405:25
    |
405 |             txd.set_gen(gen as u32);
    |                         ^^^^^^^^^^ help: try: `gen`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

Check warning on line 230 in lib/vmxnet3/src/smoltcp.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this boolean expression can be simplified

warning: this boolean expression can be simplified
   --> lib/vmxnet3/src/smoltcp.rs:230:12
    |
230 |         if !self.iobuf.is_none() {
    |            ^^^^^^^^^^^^^^^^^^^^^ help: try: `self.iobuf.is_some()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool
    = note: `#[warn(clippy::nonminimal_bool)]` on by default

Check warning on line 212 in lib/vmxnet3/src/smoltcp.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> lib/vmxnet3/src/smoltcp.rs:212:24
    |
212 |         let result = f(&mut iobuf.segments[0].as_mut_slice());
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `iobuf.segments[0].as_mut_slice()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 171 in lib/vmxnet3/src/smoltcp.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> lib/vmxnet3/src/smoltcp.rs:171:24
    |
171 |         let result = f(&mut self.iobuf.segments[0].as_mut_slice());
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.iobuf.segments[0].as_mut_slice()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `#[warn(clippy::needless_borrow)]` on by default

Check warning on line 1085 in lib/vmxnet3/src/reg.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

transmute from a type (`u32`) to itself

warning: transmute from a type (`u32`) to itself
    --> lib/vmxnet3/src/reg.rs:1085:37
     |
1085 |             let gen: u32 = unsafe { ::core::mem::transmute(gen) };
     |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_transmute

Check warning on line 1081 in lib/vmxnet3/src/reg.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

transmute from a type (`u32`) to itself

warning: transmute from a type (`u32`) to itself
    --> lib/vmxnet3/src/reg.rs:1081:39
     |
1081 |             let type_: u32 = unsafe { ::core::mem::transmute(type_) };
     |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_transmute

Check warning on line 1077 in lib/vmxnet3/src/reg.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

transmute from a type (`u32`) to itself

warning: transmute from a type (`u32`) to itself
    --> lib/vmxnet3/src/reg.rs:1077:37
     |
1077 |             let fcs: u32 = unsafe { ::core::mem::transmute(fcs) };
     |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_transmute

Check warning on line 1073 in lib/vmxnet3/src/reg.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

transmute from a type (`u32`) to itself

warning: transmute from a type (`u32`) to itself
    --> lib/vmxnet3/src/reg.rs:1073:42
     |
1073 |             let fragment: u32 = unsafe { ::core::mem::transmute(fragment) };
     |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_transmute

Check warning on line 1069 in lib/vmxnet3/src/reg.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

transmute from a type (`u32`) to itself

warning: transmute from a type (`u32`) to itself
    --> lib/vmxnet3/src/reg.rs:1069:38
     |
1069 |             let ipv4: u32 = unsafe { ::core::mem::transmute(ipv4) };
     |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_transmute

Check warning on line 1065 in lib/vmxnet3/src/reg.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

transmute from a type (`u32`) to itself

warning: transmute from a type (`u32`) to itself
    --> lib/vmxnet3/src/reg.rs:1065:38
     |
1065 |             let ipv6: u32 = unsafe { ::core::mem::transmute(ipv6) };
     |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_transmute

Check warning on line 1061 in lib/vmxnet3/src/reg.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

transmute from a type (`u32`) to itself

warning: transmute from a type (`u32`) to itself
    --> lib/vmxnet3/src/reg.rs:1061:43
     |
1061 |             let ipcsum_ok: u32 = unsafe { ::core::mem::transmute(ipcsum_ok) };
     |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_transmute