diff --git a/src/types/message.rs b/src/types/message.rs index 54cc09af..d42835ae 100644 --- a/src/types/message.rs +++ b/src/types/message.rs @@ -1435,42 +1435,43 @@ mod tests { #[test] fn de_sticker() { let json = r#"{ - "message_id": 199787, - "from": { - "id": 250918540, - "is_bot": false, - "first_name": "Андрей", - "last_name": "Власов", - "username": "aka_dude", - "language_code": "en" - }, - "chat": { - "id": 250918540, - "first_name": "Андрей", - "last_name": "Власов", - "username": "aka_dude", - "type": "private" - }, - "date": 1568290188, - "sticker": { - "width": 512, - "height": 512, - "emoji": "😡", - "set_name": "AdvenTimeAnim", - "is_animated": true, - "is_video": false, - "thumb": { - "file_id": "AAQCAAMjAAOw0PgMaabKAcaXKCBLubkPAAQBAAdtAAPGKwACFgQ", - "file_unique_id":"", - "file_size": 4118, - "width": 128, - "height": 128 - }, - "file_id": "CAADAgADIwADsND4DGmmygHGlyggFgQ", - "file_unique_id":"", - "file_size": 16639 - } - }"#; + "message_id": 199787, + "from": { + "id": 250918540, + "is_bot": false, + "first_name": "Андрей", + "last_name": "Власов", + "username": "aka_dude", + "language_code": "en" + }, + "chat": { + "id": 250918540, + "first_name": "Андрей", + "last_name": "Власов", + "username": "aka_dude", + "type": "private" + }, + "date": 1568290188, + "sticker": { + "width": 512, + "height": 512, + "emoji": "😡", + "set_name": "AdvenTimeAnim", + "is_animated": true, + "is_video": false, + "type": "regular", + "thumb": { + "file_id": "AAMCAgADGQEAARIt0GMwiZ6n4nRbxdpM3pL8vPX6PVAhAAIjAAOw0PgMaabKAcaXKCABAAdtAAMpBA", + "file_unique_id": "AQADIwADsND4DHI", + "file_size": 4118, + "width": 128, + "height": 128 + }, + "file_id": "CAACAgIAAxkBAAESLdBjMImep-J0W8XaTN6S_Lz1-j1QIQACIwADsND4DGmmygHGlyggKQQ", + "file_unique_id": "AgADIwADsND4DA", + "file_size": 16639 + } + }"#; from_str::(json).unwrap(); } diff --git a/src/types/sticker.rs b/src/types/sticker.rs index dd8d22da..4ee875fd 100644 --- a/src/types/sticker.rs +++ b/src/types/sticker.rs @@ -119,8 +119,8 @@ pub enum StickerFormat { /// let _ = sticker.is_regular(); /// let _ = sticker.kind.is_regular(); /// -/// let _ sticker.mask_position(); -/// let _ sticker.kind.mask_position(); +/// let _ = sticker.mask_position(); +/// let _ = sticker.kind.mask_position(); /// ``` impl Deref for Sticker { type Target = StickerKind; @@ -418,7 +418,7 @@ mod tests { #[test] fn sticker_format_serde() { { - let json = r#"{"is_animation":false,"is_video":false}"#; + let json = r#"{"is_animated":false,"is_video":false}"#; let fmt: StickerFormat = serde_json::from_str(json).unwrap(); assert_eq!(fmt, StickerFormat::Raster); @@ -426,7 +426,7 @@ mod tests { assert_eq!(json, json2); } { - let json = r#"{"is_animation":true,"is_video":false}"#; + let json = r#"{"is_animated":true,"is_video":false}"#; let fmt: StickerFormat = serde_json::from_str(json).unwrap(); assert_eq!(fmt, StickerFormat::Animated); @@ -434,7 +434,7 @@ mod tests { assert_eq!(json, json2); } { - let json = r#"{"is_animation":false,"is_video":true}"#; + let json = r#"{"is_animated":false,"is_video":true}"#; let fmt: StickerFormat = serde_json::from_str(json).unwrap(); assert_eq!(fmt, StickerFormat::Video); @@ -442,7 +442,7 @@ mod tests { assert_eq!(json, json2); } { - let json = r#"{"is_animation":true,"is_video":true}"#; + let json = r#"{"is_animated":true,"is_video":true}"#; let fmt: Result = serde_json::from_str(json); assert!(fmt.is_err()); }