linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>
Cc: "Viresh Kumar" <viresh.kumar@linaro.org>,
	"Vincent Guittot" <vincent.guittot@linaro.org>,
	linux-gpio@vger.kernel.org,
	"Alex Bennée" <alex.bennee@linaro.org>
Subject: [PATCH 1/2] bindings: rust: Align formatting to what's suggested by 'cargo fmt'
Date: Tue, 14 Feb 2023 12:15:34 +0530	[thread overview]
Message-ID: <24d754e5d765de80f99d8f8942d7ffeea8f3110c.1676357080.git.viresh.kumar@linaro.org> (raw)

Align code to follow what 'cargo fmt' suggests.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 bindings/rust/libgpiod/src/line_config.rs    | 13 ++++++++++---
 bindings/rust/libgpiod/tests/line_config.rs  |  4 ++--
 bindings/rust/libgpiod/tests/line_request.rs |  6 ++++--
 3 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/bindings/rust/libgpiod/src/line_config.rs b/bindings/rust/libgpiod/src/line_config.rs
index 6ddcec336da2..3848a3a68304 100644
--- a/bindings/rust/libgpiod/src/line_config.rs
+++ b/bindings/rust/libgpiod/src/line_config.rs
@@ -55,7 +55,11 @@ impl Config {
     }
 
     /// Add line settings for a set of offsets.
-    pub fn add_line_settings(&mut self, offsets: &[Offset], settings: Settings) -> Result<&mut Self> {
+    pub fn add_line_settings(
+        &mut self,
+        offsets: &[Offset],
+        settings: Settings,
+    ) -> Result<&mut Self> {
         // SAFETY: `gpiod_line_config` is guaranteed to be valid here.
         let ret = unsafe {
             gpiod::gpiod_line_config_add_line_settings(
@@ -84,8 +88,11 @@ impl Config {
         }
 
         let ret = unsafe {
-            gpiod::gpiod_line_config_set_output_values(self.config, mapped_values.as_ptr(),
-                                                       values.len() as u64)
+            gpiod::gpiod_line_config_set_output_values(
+                self.config,
+                mapped_values.as_ptr(),
+                values.len() as u64,
+            )
         };
 
         if ret == -1 {
diff --git a/bindings/rust/libgpiod/tests/line_config.rs b/bindings/rust/libgpiod/tests/line_config.rs
index 6e8962cf686c..b5a04ef8949a 100644
--- a/bindings/rust/libgpiod/tests/line_config.rs
+++ b/bindings/rust/libgpiod/tests/line_config.rs
@@ -5,11 +5,11 @@
 mod common;
 
 mod line_config {
+    use gpiosim_sys::Sim;
     use libgpiod::chip::Chip;
     use libgpiod::line::{
         self, Bias, Direction, Drive, Edge, EventClock, SettingKind, SettingVal, Value,
     };
-    use gpiosim_sys::Sim;
 
     #[test]
     fn settings() {
@@ -93,7 +93,7 @@ mod line_config {
                 Value::Active,
                 Value::InActive,
                 Value::Active,
-                Value::InActive
+                Value::InActive,
             ])
             .unwrap();
 
diff --git a/bindings/rust/libgpiod/tests/line_request.rs b/bindings/rust/libgpiod/tests/line_request.rs
index 8ec497f83406..d60e15a7a106 100644
--- a/bindings/rust/libgpiod/tests/line_request.rs
+++ b/bindings/rust/libgpiod/tests/line_request.rs
@@ -181,7 +181,8 @@ mod line_request {
             assert_eq!(config.sim_val(4).unwrap(), SimValue::InActive);
 
             // Set all values
-            config.request()
+            config
+                .request()
                 .set_values(&[
                     Value::Active,
                     Value::InActive,
@@ -193,7 +194,8 @@ mod line_request {
             assert_eq!(config.sim_val(1).unwrap(), SimValue::InActive);
             assert_eq!(config.sim_val(3).unwrap(), SimValue::Active);
             assert_eq!(config.sim_val(4).unwrap(), SimValue::InActive);
-            config.request()
+            config
+                .request()
                 .set_values(&[
                     Value::InActive,
                     Value::InActive,
-- 
2.31.1.272.g89b43f80a514


             reply	other threads:[~2023-02-14  6:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-14  6:45 Viresh Kumar [this message]
2023-02-14  6:45 ` [PATCH 2/2] bindings: rust: Update bindgen's version Viresh Kumar
2023-02-14  8:48 ` [PATCH 1/2] bindings: rust: Align formatting to what's suggested by 'cargo fmt' Bartosz Golaszewski

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=24d754e5d765de80f99d8f8942d7ffeea8f3110c.1676357080.git.viresh.kumar@linaro.org \
    --to=viresh.kumar@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=brgl@bgdev.pl \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=vincent.guittot@linaro.org \
    /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).