From c3af1144db2ac4d2ff9d4844acc635dc9d588101 Mon Sep 17 00:00:00 2001 From: StNicolay Date: Sat, 27 May 2023 22:46:08 +0300 Subject: [PATCH] delete_optional now just gets Option<&Message> --- src/handlers/utils.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/handlers/utils.rs b/src/handlers/utils.rs index d366ac9..4d9495c 100644 --- a/src/handlers/utils.rs +++ b/src/handlers/utils.rs @@ -1,4 +1,3 @@ -use std::borrow::Borrow; use teloxide::{adaptors::Throttle, prelude::*}; /// Deletes the message ignoring the errors @@ -9,9 +8,8 @@ pub async fn delete_message(bot: Throttle, msg: Message) { /// Deletes the message if there is one ignoring the errors #[inline] -pub async fn delete_optional(bot: &Throttle, msg: Option>) { +pub async fn delete_optional(bot: &Throttle, msg: Option<&Message>) { if let Some(msg) = msg { - let msg: &Message = msg.borrow(); let _ = bot.delete_message(msg.chat.id, msg.id).await; } }