Make the subscription::channel function take a FnOnce closure instead of a Fn closure and remove Sync as a requirement for its output.

This commit is contained in:
Jonathan Lindsey 2023-06-10 21:52:26 -05:00
parent c15f1b5f65
commit fcf9062679

View file

@ -417,7 +417,7 @@ where
pub fn channel<I, Fut, Message>(
id: I,
size: usize,
f: impl Fn(mpsc::Sender<Message>) -> Fut + MaybeSend + Sync + 'static,
f: impl FnOnce(mpsc::Sender<Message>) -> Fut + MaybeSend + 'static,
) -> Subscription<Message>
where
I: Hash + 'static,