mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-03 17:52:12 +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_ended`
|
||||||
- `filter_video_chat_participants_invited`
|
- `filter_video_chat_participants_invited`
|
||||||
- `filter_web_app_data`
|
- `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
|
### Fixed
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
use crate::types::{
|
use crate::types::{
|
||||||
CallbackQuery, Chat, ChatId, ChatJoinRequest, ChatMemberUpdated, Message,
|
CallbackQuery, Chat, ChatId, ChatJoinRequest, ChatMemberUpdated, Message, Update,
|
||||||
Recipient, TargetMessage, Update,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Something that may have a chat ID.
|
/// 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 {
|
impl GetChatId for Chat {
|
||||||
fn chat_id(&self) -> Option<ChatId> {
|
fn chat_id(&self) -> Option<ChatId> {
|
||||||
Some(self.id)
|
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 {
|
impl GetChatId for ChatMemberUpdated {
|
||||||
fn chat_id(&self) -> Option<ChatId> {
|
fn chat_id(&self) -> Option<ChatId> {
|
||||||
Some(self.chat.id)
|
Some(self.chat.id)
|
||||||
|
|
Loading…
Reference in a new issue