lkml.org 
[lkml]   [2023]   [May]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v1 7/7] rust: workqueue: add `try_spawn` helper method
From
Benno Lossin <benno.lossin@proton.me> 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

\
 
 \ /
  Last update: 2023-05-31 16:10    [W:0.530 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site