From dd36155ebf4f250f33128fa7471ed5d0510ebe46 Mon Sep 17 00:00:00 2001 From: Bogdan Berezovskiy <berezovskiy.sq@gmail.com> Date: Wed, 2 Oct 2024 12:46:24 +0300 Subject: [PATCH] feat: add (de)serialization derive --- CHANGELOG.md | 1 + tlua/src/values.rs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4481315a..b7b3a31a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - `network::protocol::codec::iproto_key::SQL_INFO` constant - Added optional argument timeout to `network::client::Client::connect_with_config` - Untagged enum represention as in serde with `#[encode(untagged)]` attribute +- `tlua::Nil` now supports (de)serialization via serde ### Changed - `network::protocol::codec::IProtoType` uses C language representation diff --git a/tlua/src/values.rs b/tlua/src/values.rs index d8aa6eef..02eefa0d 100644 --- a/tlua/src/values.rs +++ b/tlua/src/values.rs @@ -656,7 +656,9 @@ where } } -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] +#[derive( + Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, serde::Serialize, serde::Deserialize, +)] pub struct Nil; impl_push_read! {Nil, -- GitLab