From: Erik Schilling <erik.schilling@linaro.org>
To: Linux-GPIO <linux-gpio@vger.kernel.org>
Cc: Kent Gibson <warthog618@gmail.com>,
Viresh Kumar <viresh.kumar@linaro.org>,
Erik Schilling <erik.schilling@linaro.org>
Subject: [PATCH libgpiod 3/4] bindings: rust: clippy: drop unneeded conversions
Date: Thu, 29 Jun 2023 13:09:01 +0200 [thread overview]
Message-ID: <20230629-clippy-v1-3-9ff088713c54@linaro.org> (raw)
In-Reply-To: <20230629-clippy-v1-0-9ff088713c54@linaro.org>
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@gmail.com>
Link: https://lore.kernel.org/r/20230612154055.56556-1-warthog618@gmail.com
Signed-off-by: Erik Schilling <erik.schilling@linaro.org>
---
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
next prev parent reply other threads:[~2023-06-29 11:10 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-29 11:08 [PATCH libgpiod 0/4] bindings: rust: clippy: fixed warnings Erik Schilling
2023-06-29 11:08 ` [PATCH libgpiod 1/4] bindings: rust: clippy: drop unnecessary casts Erik Schilling
2023-06-29 11:09 ` [PATCH libgpiod 2/4] bindings: rust: clippy: silence false-positives on casts Erik Schilling
2023-06-29 11:09 ` Erik Schilling [this message]
2023-06-29 11:09 ` [PATCH libgpiod 4/4] bindings: rust: clippy: silence false-positive on iterator Erik Schilling
2023-06-30 9:08 ` Kent Gibson
2023-06-30 10:05 ` Erik Schilling
2023-06-30 10:19 ` Kent Gibson
2023-06-30 10:46 ` Erik Schilling
2023-06-30 10:50 ` Kent Gibson
2023-06-30 10:53 ` Erik Schilling
2023-07-01 13:10 ` Kent Gibson
2023-06-30 6:08 ` [PATCH libgpiod 0/4] bindings: rust: clippy: fixed warnings Viresh Kumar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230629-clippy-v1-3-9ff088713c54@linaro.org \
--to=erik.schilling@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=viresh.kumar@linaro.org \
--cc=warthog618@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).