Re: [libgpiod][PATCH V9 6/8] bindings: rust: Add examples to libgpiod crate

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

 



On 14-11-22, 11:29, Bartosz Golaszewski wrote:
> Ah, I missed that, my bad.
> 
> Would it also work in non-mutable way like
> 
> let lsettings = line::Settings::new.set_direction(Direction::Output)?;

No, since set_direction() expects a reference instead of the object itself. So
currently we need to do Settings::new() in a separate statement and so mutable
is required too. But then we don't need a build() routine to covert to lsettings
here.

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