diff options
author | Cyborus <cyborus@cyborus.xyz> | 2024-01-30 04:13:20 +0100 |
---|---|---|
committer | Cyborus <cyborus@cyborus.xyz> | 2024-01-30 04:13:20 +0100 |
commit | 2b1e6a8aae068eb41c61e7e94c17d5b4734d9704 (patch) | |
tree | 35417b1e2c1d8350cc86f2e8bd3a383379adac2d /generator/src/structs.rs | |
parent | fix warnings (diff) | |
download | forgejo-api-2b1e6a8aae068eb41c61e7e94c17d5b4734d9704.tar.xz forgejo-api-2b1e6a8aae068eb41c61e7e94c17d5b4734d9704.zip |
format
Diffstat (limited to '')
-rw-r--r-- | generator/src/structs.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/generator/src/structs.rs b/generator/src/structs.rs index 04c54fe..556b913 100644 --- a/generator/src/structs.rs +++ b/generator/src/structs.rs @@ -97,9 +97,7 @@ fn create_struct_docs(schema: &Schema) -> eyre::Result<String> { Ok(doc) } -pub fn create_query_structs_for_path( - item: &PathItem, -) -> eyre::Result<String> { +pub fn create_query_structs_for_path(item: &PathItem) -> eyre::Result<String> { let mut s = String::new(); if let Some(op) = &item.get { s.push_str(&create_query_struct(op).wrap_err("GET")?); @@ -149,7 +147,7 @@ fn create_query_struct(op: &Operation) -> eyre::Result<String> { MaybeRef::Value { value } => value, MaybeRef::Ref { _ref } => eyre::bail!("todo: add deref parameters"), }; - if let ParameterIn::Query { param: query_param} = ¶m._in { + if let ParameterIn::Query { param: query_param } = ¶m._in { let ty = crate::methods::param_type(query_param, true)?; let field_name = crate::sanitize_ident(¶m.name); fields.push_str("pub "); @@ -199,7 +197,9 @@ fn create_query_struct(op: &Operation) -> eyre::Result<String> { )?; } ParameterType::Array => { - let format = query_param.collection_format.unwrap_or(CollectionFormat::Csv); + let format = query_param + .collection_format + .unwrap_or(CollectionFormat::Csv); let item = query_param .items .as_ref() |