Re: [PATCH v8 00/10] rust: add `register!` macro
From: John Hubbard
Date: Mon Mar 09 2026 - 14:13:01 EST
On 3/9/26 8:13 AM, Alexandre Courbot wrote:
> Another revision, another redesign.
>
> This one eschews closures completely for write operations, and defaults
> to a two-argument `write` method backed by a single-argument `write_val`
> one to avoid register name repetition. The two-argument version can now
> be used in most cases thanks to a clever use of traits (thanks Gary!).
>
> We went from this syntax:
>
> bar.write_with(regs::NV_PFALCON_FALCON_DMATRFFBOFFS::of::<E>(), |r| {
> r.with_offs(src_start + pos)
> });
>
> to this one:
>
> bar.write(
> WithBase::of::<E>(),
> regs::NV_PFALCON_FALCON_DMATRFFBOFFS::zeroed().with_offs(src_start + pos),
> );
>
> While slightly more verbose, it is also much easier to read, as the
Yes, it is! Let's acknowledge the progress in readability here, even
though we are still working on minor details in the other thread. :)
thanks,
--
John Hubbard