Re: [PATCH v2 2/6] rust: types: avoid `as` casts
From: Alice Ryhl
Date: Fri Nov 08 2024 - 06:35:37 EST
On Mon, Nov 4, 2024 at 10:20 PM Tamir Duberstein <tamird@xxxxxxxxx> wrote:
>
> Replace `as` casts with `cast{,_const,_mut}` which are a bit safer.
>
> Signed-off-by: Tamir Duberstein <tamird@xxxxxxxxx>
The compiler auto-converts from *mut to *const, so only cast_mut() is
necessary. I think this will still compile if you get rid of all of
the cast_const() calls.
Alice