Fix clippy "warning: you should consider deriving a Default implementation for types::inline_keyboard_markup::InlineKeyboardMarkup"

This commit is contained in:
Waffle 2019-10-13 14:44:21 +03:00
parent 77b24eaa3f
commit 101630a3a1

View file

@ -5,7 +5,7 @@ use crate::types::InlineKeyboardButton;
/// ///
/// *Note*: This will only work in Telegram versions released after /// *Note*: This will only work in Telegram versions released after
/// 9 April, 2016. Older clients will display unsupported message. /// 9 April, 2016. Older clients will display unsupported message.
#[derive(Debug, Serialize, Deserialize, Hash, PartialEq, Eq, Clone)] #[derive(Debug, Serialize, Deserialize, Hash, PartialEq, Eq, Clone, Default)]
pub struct InlineKeyboardMarkup { pub struct InlineKeyboardMarkup {
/// Array of button rows, each represented by an Array of /// Array of button rows, each represented by an Array of
/// [`InlineKeyboardButton`] objects /// [`InlineKeyboardButton`] objects
@ -28,9 +28,7 @@ pub struct InlineKeyboardMarkup {
/// ``` /// ```
impl InlineKeyboardMarkup { impl InlineKeyboardMarkup {
pub fn new() -> Self { pub fn new() -> Self {
Self { <_>::default()
inline_keyboard: vec![],
}
} }
pub fn append_row(mut self, buttons: Vec<InlineKeyboardButton>) -> Self { pub fn append_row(mut self, buttons: Vec<InlineKeyboardButton>) -> Self {