Messages in this thread | | | Date | Sat, 5 Aug 2023 14:15:04 -0300 | Subject | Re: [PATCH v3 12/13] rust: init: add `{pin_}chain` functions to `{Pin}Init<T, E>` | From | Martin Rodriguez Reboredo <> |
| |
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>
| |