mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 14:35:36 +01:00
Remove meaningless impls
This commit is contained in:
parent
69874823d7
commit
77909e04b0
2 changed files with 2 additions and 21 deletions
|
@ -44,7 +44,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
- `filter_video_chat_ended`
|
||||
- `filter_video_chat_participants_invited`
|
||||
- `filter_web_app_data`
|
||||
- Implement `GetChatId` for `teloxide_core::types::{Chat, ChatJoinRequest, ChatMemberUpdated, Recipient, TargetMessage}`.
|
||||
- Implement `GetChatId` for `teloxide_core::types::{Chat, ChatJoinRequest, ChatMemberUpdated}`.
|
||||
|
||||
### Fixed
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
use crate::types::{
|
||||
CallbackQuery, Chat, ChatId, ChatJoinRequest, ChatMemberUpdated, Message,
|
||||
Recipient, TargetMessage, Update,
|
||||
CallbackQuery, Chat, ChatId, ChatJoinRequest, ChatMemberUpdated, Message, Update,
|
||||
};
|
||||
|
||||
/// Something that may have a chat ID.
|
||||
|
@ -27,30 +26,12 @@ impl GetChatId for Update {
|
|||
}
|
||||
}
|
||||
|
||||
impl GetChatId for Recipient {
|
||||
fn chat_id(&self) -> Option<ChatId> {
|
||||
match self {
|
||||
Recipient::Id(chat_id) => Some(*chat_id),
|
||||
Recipient::ChannelUsername(_) => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl GetChatId for Chat {
|
||||
fn chat_id(&self) -> Option<ChatId> {
|
||||
Some(self.id)
|
||||
}
|
||||
}
|
||||
|
||||
impl GetChatId for TargetMessage {
|
||||
fn chat_id(&self) -> Option<ChatId> {
|
||||
match self {
|
||||
TargetMessage::Common { chat_id: recipient, .. } => recipient.chat_id(),
|
||||
TargetMessage::Inline { .. } => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl GetChatId for ChatMemberUpdated {
|
||||
fn chat_id(&self) -> Option<ChatId> {
|
||||
Some(self.chat.id)
|
||||
|
|
Loading…
Reference in a new issue