Re: [RFC PATCH v7 3/4] rust: add minimal IIO subsystem abstractions

From: Muchamad Coirul Anwar

Date: Tue Nov 24 2026 - 21:25:13 EST


On Mon, 23 Nov 2026 at 04:26, Igor Korotin <igor.korotin@xxxxxxxxx> wrote:
>
> Clippy shows two issues in iio.rs:
>
> 1. Line 332 -- ..unsafe { zeroed() } in VTABLE. The SAFETY reasoning is
> already written above the const, but clippy's undocumented_unsafe_blocks
> wants its own comment immediately above that specific line.
>
> 2. Line 408 -- unsafe { (&*priv_ptr).channels() }, drop the &:
> unsafe { (*priv_ptr).channels() }. needless_borrow, no semantic change.

Hi Igor,

Thanks for the review.

I plan to use `pin_init::zeroed()` instead, since `iio_info` implements
`Zeroable`. That removes the need for the unsafe block.
I also removed the explicit borrow, as you suggested.

Cheers,
Coirul

> Cheers
> Igor