add implementation From for ReplyMarkup

This commit is contained in:
p0lunin 2020-01-09 21:00:25 +02:00
parent c2fb937763
commit afa877ff56

View file

@ -12,3 +12,27 @@ pub enum ReplyMarkup {
ReplyKeyboardRemove(ReplyKeyboardRemove), ReplyKeyboardRemove(ReplyKeyboardRemove),
ForceReply(ForceReply), ForceReply(ForceReply),
} }
impl From<InlineKeyboardMarkup> for ReplyMarkup {
fn from(markup: InlineKeyboardMarkup) -> Self {
ReplyMarkup::Inline(markup)
}
}
impl From<ForceReply> for ReplyMarkup {
fn from(markup: ForceReply) -> Self {
ReplyMarkup::ForceReply(markup)
}
}
impl From<ReplyKeyboardMarkup> for ReplyMarkup {
fn from(markup: ReplyKeyboardMarkup) -> Self {
ReplyMarkup::ReplyKeyboardMarkup(markup)
}
}
impl From<ReplyKeyboardRemove> for ReplyMarkup {
fn from(markup: ReplyKeyboardRemove) -> Self {
ReplyMarkup::ReplyKeyboardRemove(markup)
}
}