Make use_server_future accept FnMut (#2387)

This commit is contained in:
Evan Almloff authored and GitHub committed 2024-05-04 15:30:25 +01:00
1 parent 5290b658fd
commit 40df088b7d
1 file changed
+1 -1
@@ -4,7 +4,7 @@ use std::future::Future;
/// A future that resolves to a value.
#[must_use = "Consider using `cx.spawn` to run a future without reading its value"]
pub fn use_server_future<T, F>(_future: impl Fn() -> F + 'static) -> Option<Resource<T>>
pub fn use_server_future<T, F>(_future: impl FnMut() -> F + 'static) -> Option<Resource<T>>
where
T: Serialize + DeserializeOwned + 'static,
F: Future<Output = T> + 'static,