From bfdb767a06f90c26512ec9c6a5e2d1939d7db007 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Sun, 27 Mar 2022 08:22:38 +0800 Subject: [PATCH] Make tuple-structs with public members (#328) --- src/mako/api/lib/schema.mako | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mako/api/lib/schema.mako b/src/mako/api/lib/schema.mako index 869ebad21b..b8e461207f 100644 --- a/src/mako/api/lib/schema.mako +++ b/src/mako/api/lib/schema.mako @@ -21,7 +21,7 @@ ${struct} { % endfor } % elif 'additionalProperties' in s: -${struct}(${to_rust_type(schemas, s.id, NESTED_TYPE_SUFFIX, s, allow_optionals=allow_optionals)}); +${struct}(pub ${to_rust_type(schemas, s.id, NESTED_TYPE_SUFFIX, s, allow_optionals=allow_optionals)}); % elif 'variant' in s: <% et = s.id @@ -33,7 +33,7 @@ pub enum ${et} { % if variant_type(p) != p.type_value: #[serde(rename="${p.type_value}")] % endif - ${variant_type(p)}(${to_rust_type(schemas, s.id, None, p, allow_optionals=allow_optionals)}), + ${variant_type(p)}(pub ${to_rust_type(schemas, s.id, None, p, allow_optionals=allow_optionals)}), % endfor } @@ -87,7 +87,7 @@ ${_new_object(s, s.items.get('properties'), c, allow_optionals)}\ % endif ## array item != 'object' % elif s.type == 'any': ## waiting for Default: https://github.com/rust-lang/rustc-serialize/issues/71 -pub struct ${s_type}(json::Value); +pub struct ${s_type}(pub json::Value); impl Default for ${s_type} { fn default() -> ${s_type} {