From f3ade10d00c04d126544544c9caaef00c853644b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=8B=D1=80=D1=86=D0=B5=D0=B2=20=D0=92=D0=B0=D0=B4?= =?UTF-8?q?=D0=B8=D0=BC=20=D0=98=D0=B3=D0=BE=D1=80=D0=B5=D0=B2=D0=B8=D1=87?= Date: Fri, 5 Jan 2024 18:22:42 +0300 Subject: [PATCH] Add FIXME rewrite reminder for "define_message_ext" --- crates/teloxide-core/src/types/message.rs | 4 ++++ crates/teloxide/src/dispatching/filter_ext.rs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/crates/teloxide-core/src/types/message.rs b/crates/teloxide-core/src/types/message.rs index df88ae72..b989eca0 100644 --- a/crates/teloxide-core/src/types/message.rs +++ b/crates/teloxide-core/src/types/message.rs @@ -1201,6 +1201,8 @@ mod getters { } } + // FIXME: remove references to small values (requires changing + // `define_message_ext`) #[must_use] pub fn migrate_to_chat_id(&self) -> Option<&ChatId> { match &self.kind { @@ -1212,6 +1214,8 @@ mod getters { } } + // FIXME: remove references to small values (requires changing + // `define_message_ext`) #[must_use] pub fn migrate_from_chat_id(&self) -> Option<&ChatId> { match &self.kind { diff --git a/crates/teloxide/src/dispatching/filter_ext.rs b/crates/teloxide/src/dispatching/filter_ext.rs index 98a2d698..c0ab8e04 100644 --- a/crates/teloxide/src/dispatching/filter_ext.rs +++ b/crates/teloxide/src/dispatching/filter_ext.rs @@ -53,6 +53,8 @@ mod private { impl Sealed for Message {} } +// FIXME: rewrite this macro to allow the usage of functions returning small +// values without borrowing macro_rules! define_message_ext { ($( ($func:ident, $fn_name:path) ,)*) => { define_ext! {