diff --git a/CHANGELOG.md b/CHANGELOG.md index 707bf546..7d4d5ed8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Now Vec in requests serializes into [number] instead of [ {message_id: number} ], `forward_messages`, `copy_messages` and `delete_messages` now work properly - Now `InlineQueryResultsButton` serializes properly ([issue 1181](https://github.com/teloxide/teloxide/issues/1181)) +- Now `ThreadId` is able to serialize in multipart requests ([PR 1179](https://github.com/teloxide/teloxide/pull/1179)) ## 0.13.0 - 2024-08-16 diff --git a/crates/teloxide-core/src/serde_multipart/serializers.rs b/crates/teloxide-core/src/serde_multipart/serializers.rs index a8ded25e..66454041 100644 --- a/crates/teloxide-core/src/serde_multipart/serializers.rs +++ b/crates/teloxide-core/src/serde_multipart/serializers.rs @@ -374,6 +374,17 @@ impl Serializer for PartSerializer { Ok(JsonPartSerializer { buf: String::new(), state: PartSerializerStructState::Empty }) } + fn serialize_newtype_struct( + self, + _: &'static str, + value: &T, + ) -> Result + where + T: Serialize, + { + value.serialize(self) + } + // Unimplemented fn serialize_none(self) -> Result { @@ -391,17 +402,6 @@ impl Serializer for PartSerializer { unimplemented!() } - fn serialize_newtype_struct( - self, - _: &'static str, - _: &T, - ) -> Result - where - T: Serialize, - { - unimplemented!() - } - fn serialize_newtype_variant( self, _name: &'static str,