clippy stop being so mean to me pleaaseedekdseu;}yudc})vr)f

This commit is contained in:
Maybe Waffle 2024-01-11 23:20:19 +01:00
parent 67e297db3a
commit 9abc6b9b7b
2 changed files with 5 additions and 5 deletions

View file

@ -44,6 +44,8 @@ mod polling;
#[allow(deprecated)]
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.
///
/// Implementors of this trait allow getting updates from Telegram. See
@ -73,9 +75,7 @@ pub trait UpdateListener {
/// should call `set_webhook`.
///
/// [`Stream`]: AsUpdateStream::Stream
fn listen(
&mut self,
) -> Pin<Box<dyn Future<Output = Result<Self::Stream<'_>, Self::SetupErr>> + Send + '_>>;
fn listen(&mut self) -> BoxFut<'_, Result<Self::Stream<'_>, Self::SetupErr>>;
/// Hint which updates should the listener listen for.
///

View file

@ -447,9 +447,9 @@ fn polling_is_send() {
assert_send(&polling.listen());
assert_send(&polling.stop_token());
_ = async {
drop(async {
assert_send(&polling.listen().await.unwrap());
};
});
fn assert_send(_: &impl Send) {}
}