diff options
author | Benno Lossin <lossin@kernel.org> | 2025-05-23 16:50:57 +0200 |
---|---|---|
committer | Benno Lossin <lossin@kernel.org> | 2025-06-11 21:13:56 +0200 |
commit | 101b7cf006d4b4b98652bd15dc36e63ede8f8ad8 (patch) | |
tree | e41ff1eb71561024bd85b700727ef30359a29e85 /rust/pin-init/examples/big_struct_in_place.rs | |
parent | b3b4f760ccf2d08ff3db0f094c32ce70bba2eb15 (diff) |
rust: pin-init: rename `zeroed` to `init_zeroed`
The name `zeroed` is a much better fit for a function that returns the
type by-value.
Link: https://github.com/Rust-for-Linux/pin-init/pull/56/commits/7dbe38682c9725405bab91dcabe9c4d8893d2f5e
[ also rename uses in `rust/kernel/init.rs` - Benno]
Link: https://lore.kernel.org/all/20250523145125.523275-2-lossin@kernel.org
[ Fix wrong replacement of `mem::zeroed` in the definition of `trait
Zeroable`. - Benno ]
[ Also change occurrences of `zeroed` in `configfs.rs` - Benno ]
Acked-by: Andreas Hindborg <a.hindborg@kernel.org>
Signed-off-by: Benno Lossin <lossin@kernel.org>
Diffstat (limited to 'rust/pin-init/examples/big_struct_in_place.rs')
-rw-r--r-- | rust/pin-init/examples/big_struct_in_place.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rust/pin-init/examples/big_struct_in_place.rs b/rust/pin-init/examples/big_struct_in_place.rs index b0ee793a0a0c..c05139927486 100644 --- a/rust/pin-init/examples/big_struct_in_place.rs +++ b/rust/pin-init/examples/big_struct_in_place.rs @@ -21,7 +21,7 @@ pub struct ManagedBuf { impl ManagedBuf { pub fn new() -> impl Init<Self> { - init!(ManagedBuf { buf <- zeroed() }) + init!(ManagedBuf { buf <- init_zeroed() }) } } @@ -30,7 +30,7 @@ fn main() { { // we want to initialize the struct in-place, otherwise we would get a stackoverflow let buf: Box<BigStruct> = Box::init(init!(BigStruct { - buf <- zeroed(), + buf <- init_zeroed(), a: 7, b: 186, c: 7789, |