Correct a comment

This commit is contained in:
Maybe Waffle 2022-09-05 18:56:24 +04:00
parent 8917e05bf8
commit 11fe8baebf

View file

@ -124,13 +124,9 @@ pub trait AsUpdateStream<'a> {
type StreamErr; type StreamErr;
/// The stream of updates from Telegram. /// The stream of updates from Telegram.
// HACK: There is currently no way to write something like // NB: `Send` is not strictly required here, but it makes it easier to return
// `-> impl for<'a> AsUpdateStream<'a, E, Stream: Send>`. Since we return // `impl AsUpdateStream` and also you want `Send` streams almost (?) always
// `impl UpdateListener<E>` from `polling`, we need to have `Send` bound here, // anyway.
// to make the stream `Send`.
//
// Without this it's, for example, impossible to spawn a tokio task with
// teloxide polling.
type Stream: Stream<Item = Result<Update, Self::StreamErr>> + Send + 'a; type Stream: Stream<Item = Result<Update, Self::StreamErr>> + Send + 'a;
/// Creates the update [`Stream`]. /// Creates the update [`Stream`].