Re: [libgpiod][PATCH v3] treewide: unify gpiod_line_config/request_get_offsets() functions

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

 



On 23-01-23, 16:34, Bartosz Golaszewski wrote:
> diff --git a/bindings/rust/libgpiod/src/line_config.rs b/bindings/rust/libgpiod/src/line_config.rs
> +    /// Get a mapping of offsets to line settings stored by this object.
> +    pub fn line_settings(&self) -> Result<SettingsMap> {
> +        let mut map = SettingsMap::new();
> +        // SAFETY: gpiod_line_config is guaranteed to be valid here
> +        let num_lines = unsafe { gpiod::gpiod_line_config_get_num_configured_offsets(self.config) };
> +        let mut offsets = vec![0; num_lines as usize];
> +
> +        // SAFETY: gpiod_line_config is guaranteed to be valid here.
> +        let num_stored = unsafe { gpiod::gpiod_line_config_get_configured_offsets(
> +                                                                self.config,
> +                                                                offsets.as_mut_ptr(),
> +                                                                num_lines) };

Hmm, this isn't formatted in the cargo suggested way.

You sure you don't get anything with:

cargo fmt --all -- --check

?

I also see that cargo fmt reports issues in master branch too, which
must have happened during your previous set of patches.

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