lkml.org 
[lkml]   [2023]   [Jul]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
Subject[PATCH 5/7] rust: init: add `..Zeroable::zeroed()` syntax for zeroing all missing fields
From
Benno Lossin <benno.lossin@proton.me> writes:
> Add the struct update syntax to the init macros, but only for
> `..Zeroable::zeroed()`. Adding this at the end of the struct initializer
> allows one to omit fields from the initializer, these fields will be
> initialized with 0x00 set to every byte. Only types that implement the
> `Zeroable` trait can utilize this.
>
> Suggested-by: Asahi Lina <lina@asahilina.net>
> Signed-off-by: Benno Lossin <benno.lossin@proton.me>

I'm a bit surprised by how large this change is, but it looks ok.

Reviewed-by: Alice Ryhl <aliceryhl@google.com>

\
 
 \ /
  Last update: 2023-07-03 13:59    [W:0.190 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site