Re: [PATCH V6 3/8] libgpiod: Add rust wrapper crate

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

 



On 17-10-22, 19:34, Kent Gibson wrote:
> > +    pub fn set_prop(&mut self, props: &[SettingVal]) -> Result<()> {
>                                                                   ^   
>                                                         also &mut Self
> 
> Apart from that, yeah that is what I had in mind, as also noted in my
> forthcoming v7 review.

Ahh yes.

diff --git a/bindings/rust/libgpiod/src/line_settings.rs b/bindings/rust/libgpiod/src/line_settings.rs
index be50b5b41c5a..92e8928517f7 100644
--- a/bindings/rust/libgpiod/src/line_settings.rs
+++ b/bindings/rust/libgpiod/src/line_settings.rs
@@ -70,7 +70,7 @@ impl Settings {
     }

     /// Set line prop setting.
-    pub fn set_prop(&mut self, props: &[SettingVal]) -> Result<()> {
+    pub fn set_prop(&mut self, props: &[SettingVal]) -> Result<&mut Self> {
         for property in props {
             match property {
                 SettingVal::Direction(prop) => self.set_direction(*prop)?,
@@ -84,7 +84,7 @@ impl Settings {
             };
         }

-        Ok(())
+        Ok(self)
     }

     /// Get the line prop setting.

-- 
viresh



[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