mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 14:35:36 +01:00
clippy stop being so mean to me pleaaseedekdseu;}yudc})vr)f
This commit is contained in:
parent
67e297db3a
commit
9abc6b9b7b
2 changed files with 5 additions and 5 deletions
|
@ -44,6 +44,8 @@ mod polling;
|
||||||
#[allow(deprecated)]
|
#[allow(deprecated)]
|
||||||
pub use self::polling::{polling, polling_default, Polling, PollingBuilder, PollingStream};
|
pub use self::polling::{polling, polling_default, Polling, PollingBuilder, PollingStream};
|
||||||
|
|
||||||
|
type BoxFut<'a, T> = Pin<Box<dyn Future<Output = T> + Send + 'a>>;
|
||||||
|
|
||||||
/// An update listener.
|
/// An update listener.
|
||||||
///
|
///
|
||||||
/// Implementors of this trait allow getting updates from Telegram. See
|
/// Implementors of this trait allow getting updates from Telegram. See
|
||||||
|
@ -73,9 +75,7 @@ pub trait UpdateListener {
|
||||||
/// should call `set_webhook`.
|
/// should call `set_webhook`.
|
||||||
///
|
///
|
||||||
/// [`Stream`]: AsUpdateStream::Stream
|
/// [`Stream`]: AsUpdateStream::Stream
|
||||||
fn listen(
|
fn listen(&mut self) -> BoxFut<'_, Result<Self::Stream<'_>, Self::SetupErr>>;
|
||||||
&mut self,
|
|
||||||
) -> Pin<Box<dyn Future<Output = Result<Self::Stream<'_>, Self::SetupErr>> + Send + '_>>;
|
|
||||||
|
|
||||||
/// Hint which updates should the listener listen for.
|
/// Hint which updates should the listener listen for.
|
||||||
///
|
///
|
||||||
|
|
|
@ -447,9 +447,9 @@ fn polling_is_send() {
|
||||||
assert_send(&polling.listen());
|
assert_send(&polling.listen());
|
||||||
assert_send(&polling.stop_token());
|
assert_send(&polling.stop_token());
|
||||||
|
|
||||||
_ = async {
|
drop(async {
|
||||||
assert_send(&polling.listen().await.unwrap());
|
assert_send(&polling.listen().await.unwrap());
|
||||||
};
|
});
|
||||||
|
|
||||||
fn assert_send(_: &impl Send) {}
|
fn assert_send(_: &impl Send) {}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue