Re: [libgpiod][PATCH 1/3] bindings: rust: fix soundness of line_info modeling

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

 



On 29-09-23, 12:58, Erik Schilling wrote:
> I think staying with `&Info` keeps the API a lot simpler (and this code
> simpler).

Right.

> >
> > > We would still need to cast it the same way. One _could_ write:
> > > 
> > >     fn as_raw_ptr(&self) -> *mut gpiod::gpiod_line_info {
> > >         &self.info as *const _ as *mut _
> > >     }
> >
> > Can we use deref to just do this magically for us in this file somehow ?
> 
> Hm... Not exactly sure what you mean here. Do you mean a `Deref`
> implementation? That one would leak this implementation detail into
> public API.

I was thinking of something else, not worth it. This is fine.

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