From ced05a2bb6b66d30208520d0791f4fa298c429e2 Mon Sep 17 00:00:00 2001 From: Brian Olsen Date: Mon, 22 Jul 2024 16:51:42 +0200 Subject: feat(tvix/nix-compat-derive): Add deriver for NixDeserialize This adds a nix-compat-derive derive crate that implements a deriver for NixDeserialize implementations. This is to reduce the amount of code needed to implement deserialization for all the types used by the Nix daemon protocol. Change-Id: I484724b550e8a1d5e9adad9555d9dc1374ae95c2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/12022 Autosubmit: Brian Olsen Tested-by: BuildkiteCI Reviewed-by: flokli --- .../tests/ui/deserialize_missing_default.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tvix/nix-compat-derive-tests/tests/ui/deserialize_missing_default.rs (limited to 'tvix/nix-compat-derive-tests/tests/ui/deserialize_missing_default.rs') diff --git a/tvix/nix-compat-derive-tests/tests/ui/deserialize_missing_default.rs b/tvix/nix-compat-derive-tests/tests/ui/deserialize_missing_default.rs new file mode 100644 index 000000000000..e9df62845518 --- /dev/null +++ b/tvix/nix-compat-derive-tests/tests/ui/deserialize_missing_default.rs @@ -0,0 +1,12 @@ +use nix_compat_derive::NixDeserialize; + +#[derive(NixDeserialize)] +pub struct Value(String); + +#[derive(NixDeserialize)] +pub struct Test { + #[nix(version = "20..")] + version: Value, +} + +fn main() {} -- cgit 1.4.1