Merge pull request #2827 from ryco117/master

Relax Task::perform from Fn to more general FnOnce
This commit is contained in:
Héctor 2025-03-05 12:09:43 +01:00 committed by GitHub
commit 7e0d6a13fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -37,7 +37,7 @@ impl<T> Task<T> {
/// output with the given closure.
pub fn perform<A>(
future: impl Future<Output = A> + MaybeSend + 'static,
f: impl Fn(A) -> T + MaybeSend + 'static,
f: impl FnOnce(A) -> T + MaybeSend + 'static,
) -> Self
where
T: MaybeSend + 'static,