Re: [PATCH 2/5] rust: types: avoid `as` casts, narrow unsafe scope

From: Alice Ryhl
Date: Thu Oct 31 2024 - 04:47:11 EST


On Wed, Oct 30, 2024 at 9:46 PM Tamir Duberstein <tamird@xxxxxxxxx> wrote:
>
> Replace `as` casts with `cast{,_const,_mut}` which are a bit safer.
>
> Reduce the scope of unsafe blocks and add missing safety comments where
> an unsafe block has been split into several unsafe blocks.

Reducing the scope of unsafe is good, but moving calls to "cast"
outside of the scope is excessive IMO.

Alice