From 4d703e2dcf506315d55fd40a33874ec9131baf85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=8B=D1=80=D1=86=D0=B5=D0=B2=20=D0=92=D0=B0=D0=B4?= =?UTF-8?q?=D0=B8=D0=BC=20=D0=98=D0=B3=D0=BE=D1=80=D0=B5=D0=B2=D0=B8=D1=87?= Date: Tue, 11 Jun 2024 12:36:38 +0300 Subject: [PATCH] Add deprecation for the StickerSet::{format, is_static, is_animated, is_video} --- crates/teloxide-core/src/types/sticker_set.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/crates/teloxide-core/src/types/sticker_set.rs b/crates/teloxide-core/src/types/sticker_set.rs index d0b5a36d..e86740e8 100644 --- a/crates/teloxide-core/src/types/sticker_set.rs +++ b/crates/teloxide-core/src/types/sticker_set.rs @@ -51,8 +51,13 @@ impl Deref for StickerSet { } impl StickerSet { + // FIXME: remove deprecation, when it will be a way to determine the format of + // the sticker set /// Returns the format of the stickers in this set #[must_use] + #[deprecated(note = "TBA7.2 brought the breaking change: flags 'is_video' and 'is_animated' \ + were removed, so currently there is no way to determine the format of \ + the sticker set in the currently supported version (TBA6.6)")] pub fn format(&self) -> StickerFormat { self.flags.format() } @@ -63,6 +68,9 @@ impl StickerSet { /// /// [`self.format().is_static()`]: StickerFormat::is_static #[must_use] + #[deprecated(note = "TBA7.2 brought the breaking change: flags 'is_video' and 'is_animated' \ + were removed, so currently there is no way to determine the format of \ + the sticker set in the currently supported version (TBA6.6)")] pub fn is_static(&self) -> bool { self.format().is_static() } @@ -74,6 +82,9 @@ impl StickerSet { /// [`self.format().is_animated()`]: StickerFormat::is_animated /// [animated]: https://telegram.org/blog/animated-stickers #[must_use] + #[deprecated(note = "TBA7.2 brought the breaking change: flags 'is_video' and 'is_animated' \ + were removed, so currently there is no way to determine the format of \ + the sticker set in the currently supported version (TBA6.6)")] pub fn is_animated(&self) -> bool { self.format().is_animated() } @@ -85,6 +96,9 @@ impl StickerSet { /// [`self.format().is_video()`]: StickerFormat::is_video /// [video]: https://telegram.org/blog/video-stickers-better-reactions #[must_use] + #[deprecated(note = "TBA7.2 brought the breaking change: flags 'is_video' and 'is_animated' \ + were removed, so currently there is no way to determine the format of \ + the sticker set in the currently supported version (TBA6.6)")] pub fn is_video(&self) -> bool { self.format().is_video() }