Re: [PATCH v1 7/7] rust: workqueue: add `try_spawn` helper method

From: Alice Ryhl
Date: Wed May 31 2023 - 10:09:06 EST


Benno Lossin <benno.lossin@xxxxxxxxx> writes:
>> + /// Tries to spawn the given function or closure as a work item.
>> + ///
>> + /// This method can fail because it allocates memory to store the work item.
>> + pub fn try_spawn<T: 'static + Send + Fn()>(&self, func: T) -> Result {
>
> Why is this `Fn()` instead of `FnOnce()`?

That's a mistake. Good catch. It will be fixed in the next version.

Alice