Relax perform from Fn to more general FnOnce

This commit is contained in:
Ryan Andersen 2025-03-04 22:39:38 -08:00
parent beddf49c76
commit b9ebf45a03

View file

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