From b5003d8b34563437b1c563df5296e68cd5d9e7be Mon Sep 17 00:00:00 2001 From: Waffle Date: Mon, 22 Mar 2021 10:48:56 +0300 Subject: [PATCH] Fix typo: ReplyMarkup::{keyboad => keyboard} This commit adds `ReplyMarkup::keyboard}` and deprecates `ReplyMarkup::keyboad`. --- CHANGELOG.md | 7 +++++++ src/types/reply_markup.rs | 13 ++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a97e221a..0dda49dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [unreleased] +## [0.2.2] - 2020-03-22 + +### Fixed + +- Typo: `ReplyMarkup::{keyboad => keyboard}` ([#69][pr69]) + - Note: method with the old name was deprecated and hidden from docs + ## [0.2.1] - 2020-03-19 ### Fixed diff --git a/src/types/reply_markup.rs b/src/types/reply_markup.rs index 233f2584..838aff35 100644 --- a/src/types/reply_markup.rs +++ b/src/types/reply_markup.rs @@ -36,7 +36,7 @@ impl ReplyMarkup { /// `ReplyMarkup::Keyboard(KeyboardMarkup::new(_))`. /// /// [`Keyboard`]: ReplyMarkup::Keyboard - pub fn keyboad(keyboard: K) -> Self + pub fn keyboard(keyboard: K) -> Self where K: IntoIterator, K::Item: IntoIterator, @@ -62,6 +62,17 @@ impl ReplyMarkup { pub fn force_reply() -> Self { Self::ForceReply(ForceReply::new()) } + + // FIXME(waffle): remove this method in the next minor version bump (0.3.0) + #[doc(hidden)] + #[deprecated = "This method has a typo in name. Use `ReplyMarkup::keyboard` instead."] + pub fn keyboad(keyboard: K) -> Self + where + K: IntoIterator, + K::Item: IntoIterator, + { + Self::Keyboard(KeyboardMarkup::new(keyboard)) + } } #[cfg(test)]