FutureExt::map only requires the more generic FnOnce trait (a function capable of being called once) whereas perform currently requires a function capable of being called arbitrarily many times. Should be safe:
Since both Fn and FnMut are subtraits of FnOnce, any instance of Fn or FnMut can be used where a FnOnce is expected.source
FutureExt::map
only requires the more genericFnOnce
trait (a function capable of being called once) whereasperform
currently requires a function capable of being called arbitrarily many times. Should be safe:Since both Fn and FnMut are subtraits of FnOnce, any instance of Fn or FnMut can be used where a FnOnce is expected.
source