Skip to content

Commit 65890fb

Browse files
committed
rust: types: Add Opaque::zeroed()
Signed-off-by: Asahi Lina <[email protected]>
1 parent f369afc commit 65890fb

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

rust/kernel/types.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,11 @@ impl<T> Opaque<T> {
237237
Self(MaybeUninit::uninit())
238238
}
239239

240+
/// Creates a zeroed value.
241+
pub fn zeroed() -> Self {
242+
Self(MaybeUninit::zeroed())
243+
}
244+
240245
/// Creates a pin-initializer from the given initializer closure.
241246
///
242247
/// The returned initializer calls the given closure with the pointer to the inner `T` of this

0 commit comments

Comments
 (0)