Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteOtter committed Feb 26, 2024
1 parent 68ed9ed commit d812447
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/bindgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ pub fn type_to_string(ty: &ReferenceOr<Schema>) -> String {
int_size.to_owned()
}
// JSON object, but Rust has no easy way to support this, so just ask for a string.
Type::Object(_) => "Option<std::collections::HashMap<String, serde_json::Value>>".to_owned(),
Type::Object(_) => {
"Option<std::collections::HashMap<String, serde_json::Value>>".to_owned()
}
Type::Boolean(_) => "bool".to_owned(),
Type::Array(x) => {
let items = x.items.as_ref().unwrap().clone().unbox();
Expand All @@ -166,7 +168,7 @@ pub fn type_to_string(ty: &ReferenceOr<Schema>) -> String {
},
SchemaKind::AllOf { all_of } => {
format!("Option<{}>", type_to_string(&all_of[0].clone()))
},
}
// Very likely a JSON object.
_ => "serde_json::Value".to_owned(),
};
Expand Down

0 comments on commit d812447

Please sign in to comment.