Re: [PATCH v2] rust: lock: Export Guard::do_unlocked()

From: Miguel Ojeda
Date: Thu Jul 24 2025 - 16:08:24 EST


On Thu, Jul 24, 2025 at 8:28 PM Lyude Paul <lyude@xxxxxxxxxx> wrote:
>
> + /// Releases this [`Guard`]'s lock temporary, executes `cb` and then re-acquires it.

temporarily?

> + /// If the closure returns a value, it will be returned by this function.

Perhaps we can simplify by avoiding the conditional:

It returns the value returned by the closure.

> + /// # use pin_init::stack_pin_init;
> + ///
> + /// fn assert_held<T, B: Backend>(guard: &Guard<'_, T, B>, lock: &Lock<T, B>) {

We need to remove the newline to avoid an empty line in the rendered output.

Cheers,
Miguel