@@ -49,25 +49,25 @@ pub fn response_for_query(
4949 . find ( |op| op. name == selected_operation)
5050 . map ( |i| i. to_owned ( ) ) ;
5151
52- let opt_operation = context. selected_operation . clone ( ) . or_else ( || {
53- operations
54- . iter ( )
55- . next ( )
56- . map ( |i| i. to_owned ( ) )
57- } ) ;
52+ let opt_operation = context
53+ . selected_operation
54+ . clone ( )
55+ . or_else ( || operations. iter ( ) . next ( ) . map ( |i| i. to_owned ( ) ) ) ;
5856 let operation = if let Some ( operation) = opt_operation {
5957 operation
6058 } else {
6159 panic ! ( "no operation '{}' in query document" , selected_operation) ;
6260 } ;
6361
6462 let response_data_fields = {
65- let opt_root_name = operation
66- . root_name ( & context. schema ) ;
63+ let opt_root_name = operation. root_name ( & context. schema ) ;
6764 let root_name: String = if let Some ( root_name) = opt_root_name {
6865 root_name
6966 } else {
70- panic ! ( "operation type '{:?}' not in schema" , operation. operation_type) ;
67+ panic ! (
68+ "operation type '{:?}' not in schema" ,
69+ operation. operation_type
70+ ) ;
7171 } ;
7272 let definition = context
7373 . schema
@@ -94,17 +94,13 @@ pub fn response_for_query(
9494 . unwrap ( )
9595 } ;
9696
97- let enum_definitions = context
98- . schema
99- . enums
100- . values ( )
101- . filter_map ( |enm| {
102- if enm. is_required . get ( ) {
103- Some ( enm. to_rust ( & context) )
104- } else {
105- None
106- }
107- } ) ;
97+ let enum_definitions = context. schema . enums . values ( ) . filter_map ( |enm| {
98+ if enm. is_required . get ( ) {
99+ Some ( enm. to_rust ( & context) )
100+ } else {
101+ None
102+ }
103+ } ) ;
108104 let fragment_definitions: Result < Vec < TokenStream > , _ > = context
109105 . fragments
110106 . values ( )
@@ -114,8 +110,7 @@ pub fn response_for_query(
114110 } else {
115111 None
116112 }
117- } )
118- . collect ( ) ;
113+ } ) . collect ( ) ;
119114 let fragment_definitions = fragment_definitions?;
120115 let variables_struct = operation. expand_variables ( & context) ;
121116
@@ -129,8 +124,7 @@ pub fn response_for_query(
129124 } else {
130125 None
131126 }
132- } )
133- . collect ( ) ;
127+ } ) . collect ( ) ;
134128 let input_object_definitions = input_object_definitions?;
135129
136130 let scalar_definitions: Vec < TokenStream > = context
@@ -143,8 +137,7 @@ pub fn response_for_query(
143137 } else {
144138 None
145139 }
146- } )
147- . collect ( ) ;
140+ } ) . collect ( ) ;
148141
149142 let response_derives = context. response_derives ( ) ;
150143
0 commit comments