diff --git a/src/filters/command.rs b/src/filters/command.rs index eb84af96..7cd44b50 100644 --- a/src/filters/command.rs +++ b/src/filters/command.rs @@ -300,7 +300,7 @@ impl Command<'_> { if self.ignore_mention { Ok(true) } else if let Some(ref mention) = command.mention { - bot.send(GetMe).await.map(|user| { + bot.send(GetMe {}).await.map(|user| { // `unwrap` is safe here, because bot always has username user.username.unwrap() == *mention }) diff --git a/src/methods/close.rs b/src/methods/close.rs index aecbbfee..64387637 100644 --- a/src/methods/close.rs +++ b/src/methods/close.rs @@ -13,8 +13,8 @@ use serde::Serialize; pub struct Close {} impl Close { - pub fn new() -> Self { - Self::default() + pub const fn new() -> Self { + Self {} } } diff --git a/src/methods/get_forum_topic_icon_stickers.rs b/src/methods/get_forum_topic_icon_stickers.rs index af1ac7df..f640bedd 100644 --- a/src/methods/get_forum_topic_icon_stickers.rs +++ b/src/methods/get_forum_topic_icon_stickers.rs @@ -16,8 +16,8 @@ pub struct GetForumTopicIconStickers {} impl GetForumTopicIconStickers { #[must_use] - pub fn new() -> Self { - Self::default() + pub const fn new() -> Self { + Self {} } } diff --git a/src/methods/get_me.rs b/src/methods/get_me.rs index 7c2debaf..fc99de38 100644 --- a/src/methods/get_me.rs +++ b/src/methods/get_me.rs @@ -10,12 +10,12 @@ use serde::Serialize; /// # Returns /// Returns basic information about the bot in form of a [`User`] object #[derive(Debug, Default, Clone, Hash, PartialEq, Eq, Serialize)] -pub struct GetMe; +pub struct GetMe {} impl GetMe { #[must_use] pub const fn new() -> Self { - Self + Self {} } } diff --git a/src/methods/log_out.rs b/src/methods/log_out.rs index 60a93699..291adb5d 100644 --- a/src/methods/log_out.rs +++ b/src/methods/log_out.rs @@ -14,8 +14,8 @@ pub struct LogOut {} impl LogOut { #[must_use] - pub fn new() -> Self { - Self::default() + pub const fn new() -> Self { + Self {} } } diff --git a/src/types/bot_command_scope_all_chat_administrators.rs b/src/types/bot_command_scope_all_chat_administrators.rs index 73de15ef..c50a1f22 100644 --- a/src/types/bot_command_scope_all_chat_administrators.rs +++ b/src/types/bot_command_scope_all_chat_administrators.rs @@ -4,11 +4,11 @@ use serde::{Deserialize, Serialize}; /// # Documentation /// #[derive(Debug, Default, Clone, Hash, PartialEq, Eq, Deserialize, Serialize)] -pub struct BotCommandScopeAllChatAdministrators; +pub struct BotCommandScopeAllChatAdministrators {} impl BotCommandScopeAllChatAdministrators { #[must_use] pub const fn new() -> Self { - Self + Self {} } } diff --git a/src/types/bot_command_scope_all_group_chats.rs b/src/types/bot_command_scope_all_group_chats.rs index e199fa6a..aca058dc 100644 --- a/src/types/bot_command_scope_all_group_chats.rs +++ b/src/types/bot_command_scope_all_group_chats.rs @@ -4,11 +4,11 @@ use serde::{Deserialize, Serialize}; /// # Documentation /// #[derive(Debug, Default, Clone, Hash, PartialEq, Eq, Deserialize, Serialize)] -pub struct BotCommandScopeAllGroupChats; +pub struct BotCommandScopeAllGroupChats {} impl BotCommandScopeAllGroupChats { #[must_use] pub const fn new() -> Self { - Self + Self {} } } diff --git a/src/types/bot_command_scope_all_private_chats.rs b/src/types/bot_command_scope_all_private_chats.rs index c8b2914e..e9a240a8 100644 --- a/src/types/bot_command_scope_all_private_chats.rs +++ b/src/types/bot_command_scope_all_private_chats.rs @@ -4,11 +4,11 @@ use serde::{Deserialize, Serialize}; /// # Documentation /// #[derive(Debug, Default, Clone, Copy, Hash, PartialEq, Eq, Deserialize, Serialize)] -pub struct BotCommandScopeAllPrivateChats; +pub struct BotCommandScopeAllPrivateChats {} impl BotCommandScopeAllPrivateChats { #[must_use] pub const fn new() -> Self { - Self + Self {} } } diff --git a/src/types/bot_command_scope_default.rs b/src/types/bot_command_scope_default.rs index eefa0f61..6e367ec8 100644 --- a/src/types/bot_command_scope_default.rs +++ b/src/types/bot_command_scope_default.rs @@ -4,11 +4,11 @@ use serde::{Deserialize, Serialize}; /// # Documentation /// #[derive(Debug, Default, Clone, Copy, Hash, PartialEq, Eq, Deserialize, Serialize)] -pub struct BotCommandScopeDefault; +pub struct BotCommandScopeDefault {} impl BotCommandScopeDefault { #[must_use] pub const fn new() -> Self { - Self + Self {} } } diff --git a/src/types/callback_game.rs b/src/types/callback_game.rs index 8dd3cafb..ee100a7c 100644 --- a/src/types/callback_game.rs +++ b/src/types/callback_game.rs @@ -4,11 +4,11 @@ use serde::{Deserialize, Serialize}; /// # Documentation /// #[derive(Debug, Default, Clone, Hash, PartialEq, Eq, Deserialize, Serialize)] -pub struct CallbackGame; +pub struct CallbackGame {} impl CallbackGame { #[must_use] - pub fn new() -> Self { - Self + pub const fn new() -> Self { + Self {} } } diff --git a/src/types/game_high_score.rs b/src/types/game_high_score.rs index ae1da5e3..66c1ff3b 100644 --- a/src/types/game_high_score.rs +++ b/src/types/game_high_score.rs @@ -5,4 +5,4 @@ use serde::Deserialize; /// If you've got any questions, please check out our `https://core.telegram.org/bots/faq ` **Bot FAQ ยป** /// #[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, Deserialize)] -pub struct GameHighScore; +pub struct GameHighScore {} diff --git a/src/types/menu_button_commands.rs b/src/types/menu_button_commands.rs index ecc686ac..31719c91 100644 --- a/src/types/menu_button_commands.rs +++ b/src/types/menu_button_commands.rs @@ -4,11 +4,11 @@ use serde::{Deserialize, Serialize}; /// # Documentation /// #[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, Deserialize, Serialize)] -pub struct MenuButtonCommands; +pub struct MenuButtonCommands {} impl MenuButtonCommands { #[must_use] pub const fn new() -> Self { - Self + Self {} } } diff --git a/src/types/menu_button_default.rs b/src/types/menu_button_default.rs index 714cf6dc..11952d28 100644 --- a/src/types/menu_button_default.rs +++ b/src/types/menu_button_default.rs @@ -4,11 +4,11 @@ use serde::{Deserialize, Serialize}; /// # Documentation /// #[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, Deserialize, Serialize)] -pub struct MenuButtonDefault; +pub struct MenuButtonDefault {} impl MenuButtonDefault { #[must_use] pub const fn new() -> Self { - Self + Self {} } }