Fixes clippy warnings on these lines. Applied the suggested fix using: cargo clippy --fix clippy version: clippy 0.1.70 (90c5418 2023-05-31). Reported-by: Kent Gibson <warthog618@xxxxxxxxx> Link: https://lore.kernel.org/r/20230612154055.56556-1-warthog618@xxxxxxxxx Signed-off-by: Erik Schilling <erik.schilling@xxxxxxxxxx> --- bindings/rust/gpiosim-sys/src/sim.rs | 2 +- bindings/rust/libgpiod/src/event_buffer.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bindings/rust/gpiosim-sys/src/sim.rs b/bindings/rust/gpiosim-sys/src/sim.rs index 16c2b3e..71b9453 100644 --- a/bindings/rust/gpiosim-sys/src/sim.rs +++ b/bindings/rust/gpiosim-sys/src/sim.rs @@ -186,7 +186,7 @@ impl SimBank { fn set_num_lines(&self, num: usize) -> Result<()> { // SAFETY: `gpiosim_bank` is guaranteed to be valid here. - let ret = unsafe { gpiosim_bank_set_num_lines(self.bank, num.try_into().unwrap()) }; + let ret = unsafe { gpiosim_bank_set_num_lines(self.bank, num) }; if ret == -1 { Err(Error::OperationFailed( OperationType::SimBankSetNumLines, diff --git a/bindings/rust/libgpiod/src/event_buffer.rs b/bindings/rust/libgpiod/src/event_buffer.rs index 520eb2a..b79e9ea 100644 --- a/bindings/rust/libgpiod/src/event_buffer.rs +++ b/bindings/rust/libgpiod/src/event_buffer.rs @@ -108,7 +108,7 @@ impl Buffer { gpiod::gpiod_line_request_read_edge_events( request.request, self.buffer, - self.events.len().try_into().unwrap(), + self.events.len(), ) }; -- 2.41.0