mirror of
https://github.com/kjuulh/dagger-rs.git
synced 2025-12-29 03:01:03 +01:00
fix vec
This commit is contained in:
@@ -81,10 +81,18 @@ impl CommonFunctions {
|
||||
)
|
||||
}
|
||||
__TypeKind::LIST => {
|
||||
let mut inner_type = rf
|
||||
.of_type
|
||||
.as_ref()
|
||||
.map(|t| t.clone())
|
||||
.map(|t| *t)
|
||||
.map(|t| self.format_type(&t, input))
|
||||
.unwrap();
|
||||
|
||||
representation =
|
||||
self.format_type_funcs.format_kind_list(&mut representation);
|
||||
r = rf.of_type.as_ref().map(|t| t.clone()).map(|t| *t);
|
||||
continue;
|
||||
self.format_type_funcs.format_kind_list(&mut inner_type);
|
||||
|
||||
return representation;
|
||||
}
|
||||
__TypeKind::NON_NULL => {
|
||||
r = rf.of_type.as_ref().map(|t| t.clone()).map(|t| *t);
|
||||
|
||||
@@ -3,7 +3,7 @@ use genco::prelude::rust;
|
||||
use genco::quote;
|
||||
|
||||
use crate::functions::CommonFunctions;
|
||||
use crate::rust::functions::format_name;
|
||||
use crate::rust::functions::{format_name, format_struct_name};
|
||||
|
||||
pub fn render_input(funcs: &CommonFunctions, t: &FullType) -> eyre::Result<rust::Tokens> {
|
||||
Ok(quote! {
|
||||
@@ -30,6 +30,6 @@ pub fn render_input_fields(
|
||||
|
||||
pub fn render_input_field(funcs: &CommonFunctions, field: &FullTypeInputFields) -> rust::Tokens {
|
||||
quote! {
|
||||
$(&field.input_value.name): $(funcs.format_input_type(&field.input_value.type_))
|
||||
pub $(format_struct_name(&field.input_value.name)): $(funcs.format_input_type(&field.input_value.type_)),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ fn render_optional_field_args(
|
||||
}
|
||||
let rendered_args = args.into_iter().map(|a| &a.input_value).map(|a| {
|
||||
quote! {
|
||||
pub $(format_struct_name(&a.name)): $(funcs.format_output_type(&a.type_))
|
||||
pub $(format_struct_name(&a.name)): $(funcs.format_output_type(&a.type_)),
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user