On 10/26/25 3:39 PM, Alexandre Courbot wrote: > This patchset tries to eradicate the use of `as` in nova-core, by using > existing means and introducing new ones.
Thanks a lot for working on this cleanup! > The first 4 patches use the already-available `From` and `TryFrom` trait > where it is possible or advisable. > > The fifth patch introduces a new module that proposes conversion > functions for those that are infallible under the current build target. > This is done through a set of const functions, and the `FromAs` and > `IntoAs` extension traits which, as their names lightly suggest, offer > conversion for those types on which the `as` operator can be used > losslessly. > > This new module is put to use in the sixth patch. > > The idea was first suggested by Danilo, and I hope I captured it > properly. :) Yes, this is what I thought of. > As Danilo suggested, this could eventually find its place in the kernel > crate if the implementation is deemed to be fit, but for now let's > review and let it mature in nova-core. Yeah, I think this approach makes sense. Though, I think we want to move this to the kernel crate sooner than later, it's definitely something we want for core code and other drivers as well. Depending on the initial feedback, it might even make sense to do it right away. I won't have time for a thorough review, but at a first glance the patches all look good! Acked-by: Danilo Krummrich <[email protected]>
