From 101630a3a12aa3b0758c2b43f5a19b51c5c86e4c Mon Sep 17 00:00:00 2001 From: Waffle Date: Sun, 13 Oct 2019 14:44:21 +0300 Subject: [PATCH] Fix clippy "warning: you should consider deriving a `Default` implementation for `types::inline_keyboard_markup::InlineKeyboardMarkup`" --- src/types/inline_keyboard_markup.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/types/inline_keyboard_markup.rs b/src/types/inline_keyboard_markup.rs index 89eb625e..67bd2aa8 100644 --- a/src/types/inline_keyboard_markup.rs +++ b/src/types/inline_keyboard_markup.rs @@ -5,7 +5,7 @@ use crate::types::InlineKeyboardButton; /// /// *Note*: This will only work in Telegram versions released after /// 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 { /// Array of button rows, each represented by an Array of /// [`InlineKeyboardButton`] objects @@ -28,9 +28,7 @@ pub struct InlineKeyboardMarkup { /// ``` impl InlineKeyboardMarkup { pub fn new() -> Self { - Self { - inline_keyboard: vec![], - } + <_>::default() } pub fn append_row(mut self, buttons: Vec) -> Self {