native-windows-gui icon indicating copy to clipboard operation
native-windows-gui copied to clipboard

Clippy warning: unnecessary_mut_passed

Open gyk opened this issue 4 years ago • 1 comments

cargo clippy reports this warning for PartialUi derive macro:

warning: the method `build` doesn't need a mutable reference
   |
25 | #[derive(Default, NwgPartial)]
   |                   ^^^^^^^^^^
   |
   = note: `#[warn(clippy::unnecessary_mut_passed)]` on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed
   = note: this warning originates in the derive macro `NwgPartial` (in Nightly builds, run with -Z macro-backtrace for more info)

Adding #[allow(clippy::unnecessary_mut_passed)] to fn build_partial seems to fix it.

gyk avatar Nov 07 '21 10:11 gyk

https://docs.rs/native-windows-derive/1.0.4/native_windows_derive/derive.NwgUi.html

suqiernb avatar Nov 08 '21 00:11 suqiernb