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@linaro.org
$ 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.