@@ -2,7 +2,9 @@ use super::{Schema, StoredInputFieldType, TypeId};
22use crate :: schema:: resolve_field_type;
33use graphql_parser:: schema:: { self as parser, Definition , Document , TypeDefinition , UnionType } ;
44
5- pub ( super ) fn build_schema < ' doc , T > ( mut src : graphql_parser:: schema:: Document < ' doc , T > ) -> super :: Schema
5+ pub ( super ) fn build_schema < ' doc , T > (
6+ mut src : graphql_parser:: schema:: Document < ' doc , T > ,
7+ ) -> super :: Schema
68where
79 T : graphql_parser:: query:: Text < ' doc > ,
810 T :: Value : AsRef < str > ,
@@ -161,11 +163,16 @@ where
161163 schema. stored_unions . push ( stored_union) ;
162164}
163165
164- fn ingest_object < ' doc , T > ( schema : & mut Schema , obj : & mut graphql_parser:: schema:: ObjectType < ' doc , T > )
165- where
166+ fn ingest_object < ' doc , T > (
167+ schema : & mut Schema ,
168+ obj : & mut graphql_parser:: schema:: ObjectType < ' doc , T > ,
169+ ) where
166170 T : graphql_parser:: query:: Text < ' doc > ,
167171{
168- let object_id = schema. find_type_id ( obj. name . as_ref ( ) ) . as_object_id ( ) . unwrap ( ) ;
172+ let object_id = schema
173+ . find_type_id ( obj. name . as_ref ( ) )
174+ . as_object_id ( )
175+ . unwrap ( ) ;
169176 let mut field_ids = Vec :: with_capacity ( obj. fields . len ( ) ) ;
170177
171178 for field in obj. fields . iter_mut ( ) {
@@ -193,8 +200,10 @@ where
193200 schema. push_object ( object) ;
194201}
195202
196- fn ingest_scalar < ' doc , T > ( schema : & mut Schema , scalar : & mut graphql_parser:: schema:: ScalarType < ' doc , T > )
197- where
203+ fn ingest_scalar < ' doc , T > (
204+ schema : & mut Schema ,
205+ scalar : & mut graphql_parser:: schema:: ScalarType < ' doc , T > ,
206+ ) where
198207 T : graphql_parser:: query:: Text < ' doc > ,
199208{
200209 let name: String = scalar. name . as_ref ( ) . into ( ) ;
@@ -225,8 +234,10 @@ where
225234 schema. push_enum ( enm) ;
226235}
227236
228- fn ingest_interface < ' doc , T > ( schema : & mut Schema , interface : & mut graphql_parser:: schema:: InterfaceType < ' doc , T > )
229- where
237+ fn ingest_interface < ' doc , T > (
238+ schema : & mut Schema ,
239+ interface : & mut graphql_parser:: schema:: InterfaceType < ' doc , T > ,
240+ ) where
230241 T : graphql_parser:: query:: Text < ' doc > ,
231242{
232243 let interface_id = schema
@@ -299,7 +310,9 @@ where
299310 schema. stored_inputs . push ( input) ;
300311}
301312
302- fn objects_mut < ' a , ' doc : ' a , T > ( doc : & ' a mut Document < ' doc , T > ) -> impl Iterator < Item = & ' a mut parser:: ObjectType < ' doc , T > >
313+ fn objects_mut < ' a , ' doc : ' a , T > (
314+ doc : & ' a mut Document < ' doc , T > ,
315+ ) -> impl Iterator < Item = & ' a mut parser:: ObjectType < ' doc , T > >
303316where
304317 T : graphql_parser:: query:: Text < ' doc > ,
305318{
@@ -309,7 +322,9 @@ where
309322 } )
310323}
311324
312- fn interfaces_mut < ' a , ' doc : ' a , T > ( doc : & ' a mut Document < ' doc , T > ) -> impl Iterator < Item = & ' a mut parser:: InterfaceType < ' doc , T > >
325+ fn interfaces_mut < ' a , ' doc : ' a , T > (
326+ doc : & ' a mut Document < ' doc , T > ,
327+ ) -> impl Iterator < Item = & ' a mut parser:: InterfaceType < ' doc , T > >
313328where
314329 T : graphql_parser:: query:: Text < ' doc > ,
315330{
@@ -319,7 +334,9 @@ where
319334 } )
320335}
321336
322- fn unions_mut < ' a , ' doc : ' a , T > ( doc : & ' a mut Document < ' doc , T > ) -> impl Iterator < Item = & ' a mut parser:: UnionType < ' doc , T > >
337+ fn unions_mut < ' a , ' doc : ' a , T > (
338+ doc : & ' a mut Document < ' doc , T > ,
339+ ) -> impl Iterator < Item = & ' a mut parser:: UnionType < ' doc , T > >
323340where
324341 T : graphql_parser:: query:: Text < ' doc > ,
325342{
@@ -329,7 +346,9 @@ where
329346 } )
330347}
331348
332- fn enums_mut < ' a , ' doc : ' a , T > ( doc : & ' a mut Document < ' doc , T > ) -> impl Iterator < Item = & ' a mut parser:: EnumType < ' doc , T > >
349+ fn enums_mut < ' a , ' doc : ' a , T > (
350+ doc : & ' a mut Document < ' doc , T > ,
351+ ) -> impl Iterator < Item = & ' a mut parser:: EnumType < ' doc , T > >
333352where
334353 T : graphql_parser:: query:: Text < ' doc > ,
335354{
@@ -339,7 +358,9 @@ where
339358 } )
340359}
341360
342- fn inputs_mut < ' a , ' doc : ' a , T > ( doc : & ' a mut Document < ' doc , T > ) -> impl Iterator < Item = & ' a mut parser:: InputObjectType < ' doc , T > >
361+ fn inputs_mut < ' a , ' doc : ' a , T > (
362+ doc : & ' a mut Document < ' doc , T > ,
363+ ) -> impl Iterator < Item = & ' a mut parser:: InputObjectType < ' doc , T > >
343364where
344365 T : graphql_parser:: query:: Text < ' doc > ,
345366{
0 commit comments