From 83814c06094aeba466bb84c1f5c2ab4a7885e870 Mon Sep 17 00:00:00 2001 From: ByteOtter Date: Fri, 6 Sep 2024 16:35:04 +0200 Subject: [PATCH] Fix ciritcal bug in workaround mode Fix bug breaking type generation for sanitary structs in workaround mode --- Cargo.lock | 2 +- Cargo.toml | 2 +- Thanix.spec | 4 +++- src/structgen.rs | 4 +++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6a80eff..3d0e1c1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -258,7 +258,7 @@ dependencies = [ [[package]] name = "thanix" -version = "0.1.0-beta.6" +version = "0.1.0-beta.8" dependencies = [ "check_keyword", "clap", diff --git a/Cargo.toml b/Cargo.toml index 5704752..17a4af0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "thanix" authors = ["Christopher Hock "] -version = "0.1.0-beta.7" +version = "0.1.0-beta.8" publish = true edition = "2021" description = "A yaml-to-rust code generator for generating Rust code from yaml config files e.g. as found in openAPI." diff --git a/Thanix.spec b/Thanix.spec index 7c3a7a9..41da8ad 100644 --- a/Thanix.spec +++ b/Thanix.spec @@ -17,7 +17,7 @@ Name: Thanix -Version: 0.1.0_beta.7 +Version: 0.1.0_beta.8 Release: 0.1 Summary: Rust to yaml code generator # FIXME: Select a correct license from https://github.com/openSUSE/spec-cleaner#spdx-licenses @@ -59,6 +59,8 @@ install -m 0755 %{_builddir}/%{name}-%{version}/target/release/%{bin_name} %{bui %doc README.md %changelog +* Fri Sep 06 2024 Christopher Hock - 0.1.0_beta.8-0.1 +- Fix critical bug in workflow mode breaking type generation for sanitary structs * Fri Sep 06 2024 Christopher Hock - 0.1.0_beta.7-0.1 - Fix the version module not being public in output * Fri Sep 06 2024 Christopher Hock - 0.1.0_beta.6-0.1 diff --git a/src/structgen.rs b/src/structgen.rs index 8671266..34b678b 100644 --- a/src/structgen.rs +++ b/src/structgen.rs @@ -69,7 +69,9 @@ pub fn gen(name: &str, schema: &Schema, workaround_mode: bool) -> Option && !result.ends_with("\tpub id:") { result += &format!("Option<{}>", type_name); - } + } else { + result += &type_name; + } } else { result += &type_name; }