Skip to content

Commit

Permalink
Add dervie to struct generation
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteOtter committed Jan 22, 2024
1 parent 4d161d8 commit b3b9414
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "thanix"
authors = ["Christopher Hock <[email protected]>"]
version = "0.1.0-alpha.5"
version = "0.1.0-alpha.6"
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."
Expand Down
8 changes: 1 addition & 7 deletions src/bindgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,13 +327,7 @@ pub fn gen(input_path: impl AsRef<std::path::Path>) {

let mut type_result = match yaml_type {
// "string" can mean either a plain or formatted string or an enum declaration.
"string" => match &prop.format {
Some(x) => match x.as_str() {
"uri" => "Url".to_owned(),
_ => "String".to_owned(),
},
None => "String".to_owned(),
},
"string" => "String".to_owned(),
"integer" => "i64".to_owned(),
"number" => "f64".to_owned(),
"boolean" => "bool".to_owned(),
Expand Down

0 comments on commit b3b9414

Please sign in to comment.