diff --git a/src/dispatching/dispatchers/filter.rs b/src/dispatching/dispatchers/filter.rs index 7c993a1a..5124d6a3 100644 --- a/src/dispatching/dispatchers/filter.rs +++ b/src/dispatching/dispatchers/filter.rs @@ -31,10 +31,11 @@ type FiltersWithHandlers<'a, T, E> = Vec>; /// use std::convert::Infallible; /// use teloxide::{dispatching::FilterDispatcher, RequestError}; /// -/// let _ = -/// FilterDispatcher::new(|err: Either| async { +/// let _ = FilterDispatcher::new(|err: Either| { +/// async { /// dbg!(err); -/// }); +/// } +/// }); /// ``` /// /// Or you can do it even simpler by providing the built-in error handler @@ -83,9 +84,11 @@ type FiltersWithHandlers<'a, T, E> = Vec>; /// // error handler that just ignores all errors (that can't ever happen). /// let mut dp = FilterDispatcher::::new(|_| async {}) /// // Add a handler, which handles all messages sent to the bot. -/// .message_handler(true, |mes: Message| async move { -/// println!("New message: {:?}", mes); -/// Ok(()) +/// .message_handler(true, |mes: Message| { +/// async move { +/// println!("New message: {:?}", mes); +/// Ok(()) +/// } /// }) /// // Add a handler, which handles all messages edited in a chat /// // with the bot. diff --git a/src/network/download.rs b/src/network/download.rs index 05f08f5d..0e68414f 100644 --- a/src/network/download.rs +++ b/src/network/download.rs @@ -39,11 +39,13 @@ pub async fn download_file_stream( .await? .error_for_status()?; - Ok(futures::stream::unfold(res, |mut res| async { - match res.chunk().await { - Err(err) => Some((Err(err), res)), - Ok(Some(c)) => Some((Ok(c), res)), - Ok(None) => None, + Ok(futures::stream::unfold(res, |mut res| { + async { + match res.chunk().await { + Err(err) => Some((Err(err), res)), + Ok(Some(c)) => Some((Ok(c), res)), + Ok(None) => None, + } } })) } diff --git a/src/utils/html.rs b/src/utils/html.rs index a4f5a7d9..dbd91cfa 100644 --- a/src/utils/html.rs +++ b/src/utils/html.rs @@ -121,7 +121,8 @@ mod tests { fn test_link() { assert_eq!( link("https://www.google.com/?q=foo&l=ru", ""), - "<google>", + "<google>\ + ", ); }