feat(core,sdk): remove unnecessary option returns

This commit is contained in:
2023-02-19 15:00:00 +01:00
committed by Kasper Juul Hermansen
parent 9ada74960a
commit 5d66736990
3 changed files with 183 additions and 193 deletions

View File

@@ -5,8 +5,8 @@ use genco::quote;
use genco::tokens::quoted;
use crate::functions::{
type_field_has_optional, type_ref_is_list_of_objects, type_ref_is_object,
type_ref_is_optional, CommonFunctions,
type_field_has_optional, type_ref_is_list_of_objects, type_ref_is_object, type_ref_is_optional,
CommonFunctions,
};
use crate::utility::OptionExt;
@@ -67,7 +67,7 @@ fn render_required_args(_funcs: &CommonFunctions, field: &FullTypeFields) -> Opt
let name = &s.input_value.name;
Some(quote! {
query = query.arg($(quoted(name)), $(n)).unwrap();
query = query.arg($(quoted(name)), $(n));
})
})
})
@@ -98,7 +98,7 @@ fn render_optional_args(_funcs: &CommonFunctions, field: &FullTypeFields) -> Opt
Some(quote! {
if let Some($(&n)) = opts.$(&n) {
query = query.arg($(quoted(name)), $(&n)).unwrap();
query = query.arg($(quoted(name)), $(&n));
}
})
})
@@ -163,7 +163,7 @@ fn render_execution(funcs: &CommonFunctions, field: &FullTypeFields) -> rust::To
let graphql_client = rust::import("crate::client", "graphql_client");
quote! {
query.execute(&$graphql_client(&self.conn)).unwrap().unwrap()
query.execute(&$graphql_client(&self.conn)).unwrap()
}
}