Merge pull request #1179 from LasterAlex/fix-multipart-thread-id-serialization

Fixed ThreadId serialization in multipart requests
This commit is contained in:
Lewis Pearson 2024-10-19 03:20:01 +00:00 committed by GitHub
commit 435257244c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 11 deletions

View file

@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Now Vec<MessageId> 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

View file

@ -374,6 +374,17 @@ impl Serializer for PartSerializer {
Ok(JsonPartSerializer { buf: String::new(), state: PartSerializerStructState::Empty })
}
fn serialize_newtype_struct<T: ?Sized>(
self,
_: &'static str,
value: &T,
) -> Result<Self::Ok, Self::Error>
where
T: Serialize,
{
value.serialize(self)
}
// Unimplemented
fn serialize_none(self) -> Result<Self::Ok, Self::Error> {
@ -391,17 +402,6 @@ impl Serializer for PartSerializer {
unimplemented!()
}
fn serialize_newtype_struct<T: ?Sized>(
self,
_: &'static str,
_: &T,
) -> Result<Self::Ok, Self::Error>
where
T: Serialize,
{
unimplemented!()
}
fn serialize_newtype_variant<T: ?Sized>(
self,
_name: &'static str,