From 952612a5c9a9e2a9b1c7e4dfc2e826e3890a7cb7 Mon Sep 17 00:00:00 2001 From: Artem Goncharov <artem.goncharov@gmail.com> Date: Fri, 11 Apr 2025 08:48:03 +0200 Subject: [PATCH] Sort types enum kinds alphabetically Change-Id: I5e390dbb7ecb79eef0dacca90a6897433ab1851e --- codegenerator/templates/rust_types/impl.rs.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codegenerator/templates/rust_types/impl.rs.j2 b/codegenerator/templates/rust_types/impl.rs.j2 index 99092ce..4774d17 100644 --- a/codegenerator/templates/rust_types/impl.rs.j2 +++ b/codegenerator/templates/rust_types/impl.rs.j2 @@ -78,7 +78,7 @@ use {{ mod }}; {{ subtype.derive_container_macros }} {{ subtype.serde_container_macros }} pub enum {{ subtype.name }} { - {% for kind in subtype.variants %} + {% for kind, v in subtype.variants | dictsort %} // {{ kind or "Empty" }} {{ subtype.variant_serde_macros(kind) }} {{ kind or "Empty" }}, @@ -90,7 +90,7 @@ use {{ mod }}; {{ subtype.derive_container_macros }} {{ subtype.serde_container_macros }} pub enum {{ subtype.name }} { - {% for kind, def in subtype.kinds.items() %} + {% for kind, def in subtype.kinds | dictsort %} // {{ kind }} {{ kind }}({{ def.type_hint }}), {%- endfor %}