lkml.org 
[lkml]   [2023]   [Aug]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v3 12/13] rust: init: add `{pin_}chain` functions to `{Pin}Init<T, E>`
From
On 7/29/23 06:10, Benno Lossin wrote:
> 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: Asahi Lina <lina@asahilina.net>
> Signed-off-by: Benno Lossin <benno.lossin@proton.me>
> ---
> [...]
> + /// First initializes the value using `self` then calls the function `f` with the initialized
> + /// value.
> + ///
> + /// If `f` returns an error the value is dropped and the initializer will forward the error.

It's way more clear now... Thanks!

> [...]
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>

\
 
 \ /
  Last update: 2023-08-05 19:17    [W:0.169 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site