@@ -64,24 +64,24 @@ pub enum TypeKind {
64
64
}
65
65
66
66
/// Field argument container
67
- pub struct Arguments {
68
- args : Option < HashMap < String , InputValue > > ,
67
+ pub struct Arguments < ' a > {
68
+ args : Option < HashMap < & ' a str , InputValue > > ,
69
69
}
70
70
71
- impl Arguments {
71
+ impl < ' a > Arguments < ' a > {
72
72
#[ doc( hidden) ]
73
- pub fn new ( mut args : Option < HashMap < String , InputValue > > , meta_args : & Option < Vec < Argument > > ) -> Arguments {
73
+ pub fn new ( mut args : Option < HashMap < & ' a str , InputValue > > , meta_args : & ' a Option < Vec < Argument > > ) -> Arguments < ' a > {
74
74
if meta_args. is_some ( ) && args. is_none ( ) {
75
75
args = Some ( HashMap :: new ( ) ) ;
76
76
}
77
77
78
78
if let ( & mut Some ( ref mut args) , & Some ( ref meta_args) ) = ( & mut args, meta_args) {
79
79
for arg in meta_args {
80
- if !args. contains_key ( & arg. name ) || args[ & arg. name ] . is_null ( ) {
80
+ if !args. contains_key ( arg. name . as_str ( ) ) || args[ arg. name . as_str ( ) ] . is_null ( ) {
81
81
if let Some ( ref default_value) = arg. default_value {
82
- args. insert ( arg. name . clone ( ) , default_value. clone ( ) ) ;
82
+ args. insert ( arg. name . as_str ( ) , default_value. clone ( ) ) ;
83
83
} else {
84
- args. insert ( arg. name . clone ( ) , InputValue :: null ( ) ) ;
84
+ args. insert ( arg. name . as_str ( ) , InputValue :: null ( ) ) ;
85
85
}
86
86
}
87
87
}
@@ -333,8 +333,8 @@ fn resolve_selection_set_into<T, CtxT>(
333
333
& f. name . item ,
334
334
& Arguments :: new (
335
335
f. arguments . as_ref ( ) . map ( |m|
336
- m. item . iter ( ) . cloned ( ) . map ( |( k , v) |
337
- ( k. item , v. item . into_const ( exec_vars) ) ) . collect ( ) ) ,
336
+ m. item . iter ( ) . map ( |& ( ref k , ref v) |
337
+ ( k. item . as_str ( ) , v. item . clone ( ) . into_const ( exec_vars) ) ) . collect ( ) ) ,
338
338
& meta_field. arguments ) ,
339
339
& mut sub_exec) ;
340
340
0 commit comments