[PATCH libgpiod 3/4] bindings: rust: clippy: drop unneeded conversions

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

 



Ran cargo clippy --fix on clippy 0.1.70 (90c5418 2023-05-31).

Tested build on x86_64, armv7hf, aarch64.

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.40.1




[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