Skip to content
Snippets Groups Projects
Commit 7f8977a7 authored by Benno Lossin's avatar Benno Lossin Committed by Miguel Ojeda
Browse files

rust: init: add `{pin_}chain` functions to `{Pin}Init<T, E>`


The `{pin_}chain` functions extend an initializer: it not only
initializes the value, but also executes a closure taking a reference to
the initialized value. This allows to do something with a value directly
after initialization.

Suggested-by: default avatarAsahi Lina <lina@asahilina.net>
Reviewed-by: Martin Rodriguez Reboredo's avatarMartin Rodriguez Reboredo <yakoyoku@gmail.com>
Signed-off-by: default avatarBenno Lossin <benno.lossin@proton.me>
Reviewed-by: default avatarAlice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20230814084602.25699-13-benno.lossin@proton.me


[ Cleaned a few trivial nits. ]
Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>
parent 1a8076ac
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment