Re: [libgpiod v2][PATCH V8 7/9] bindings: rust: Add tests for libgpiod crate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Oct 31, 2022 at 05:17:15PM +0530, Viresh Kumar wrote:
> Add tests for the rust bindings, quite similar to the ones in cxx
> bindings.
> 
> Signed-off-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>

$ cargo clippy --tests
    Checking libgpiod v0.1.0 (/home/kent/work/libgpiod/bindings/rust/libgpiod)
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing
   --> libgpiod/tests/edge_event.rs:103:13
    |
103 |             drop(event);
    |             ^^^^^^^^^^^
    |
    = note: `#[deny(clippy::drop_ref)]` on by default
note: argument has type `&libgpiod::request::Event`
   --> libgpiod/tests/edge_event.rs:103:18
    |
103 |             drop(event);
    |                  ^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#drop_ref

error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing
   --> libgpiod/tests/edge_event.rs:218:13
    |
218 |             drop(event);
    |             ^^^^^^^^^^^
    |
note: argument has type `&libgpiod::request::Event`
   --> libgpiod/tests/edge_event.rs:218:18
    |
218 |             drop(event);
    |                  ^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#drop_ref

error: could not compile `libgpiod` due to 2 previous errors


Those drops are now redundant as the events are returned by ref after
patch 9.
I assume they are ignored in the build, as the tests build and run,
but clippy complains.

Cheers,
Kent.



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux