@@ -4,8 +4,7 @@ use crate::format::{format_directives, Displayable, Formatter, Style};
44
55use crate :: query:: ast:: * ;
66
7- impl < ' a , T : Text < ' a > > Document < ' a , T >
8- {
7+ impl < ' a , T : Text < ' a > > Document < ' a , T > {
98 /// Format a document according to style
109 pub fn format ( & self , style : & Style ) -> String {
1110 let mut formatter = Formatter :: new ( style) ;
@@ -21,17 +20,15 @@ fn to_string<T: Displayable>(v: &T) -> String {
2120 formatter. into_string ( )
2221}
2322
24- impl < ' a , T : Text < ' a > > Displayable for Document < ' a , T >
25- {
23+ impl < ' a , T : Text < ' a > > Displayable for Document < ' a , T > {
2624 fn display ( & self , f : & mut Formatter ) {
2725 for item in & self . definitions {
2826 item. display ( f) ;
2927 }
3028 }
3129}
3230
33- impl < ' a , T : Text < ' a > > Displayable for Definition < ' a , T >
34- {
31+ impl < ' a , T : Text < ' a > > Displayable for Definition < ' a , T > {
3532 fn display ( & self , f : & mut Formatter ) {
3633 match * self {
3734 Definition :: Operation ( ref op) => op. display ( f) ,
@@ -40,8 +37,7 @@ impl<'a, T: Text<'a>> Displayable for Definition<'a, T>
4037 }
4138}
4239
43- impl < ' a , T : Text < ' a > > Displayable for OperationDefinition < ' a , T >
44- {
40+ impl < ' a , T : Text < ' a > > Displayable for OperationDefinition < ' a , T > {
4541 fn display ( & self , f : & mut Formatter ) {
4642 match * self {
4743 OperationDefinition :: SelectionSet ( ref set) => set. display ( f) ,
@@ -52,8 +48,7 @@ impl<'a, T: Text<'a>> Displayable for OperationDefinition<'a, T>
5248 }
5349}
5450
55- impl < ' a , T : Text < ' a > > Displayable for FragmentDefinition < ' a , T >
56- {
51+ impl < ' a , T : Text < ' a > > Displayable for FragmentDefinition < ' a , T > {
5752 fn display ( & self , f : & mut Formatter ) {
5853 f. margin ( ) ;
5954 f. indent ( ) ;
@@ -71,8 +66,7 @@ impl<'a, T: Text<'a>> Displayable for FragmentDefinition<'a, T>
7166 }
7267}
7368
74- impl < ' a , T : Text < ' a > > Displayable for SelectionSet < ' a , T >
75- {
69+ impl < ' a , T : Text < ' a > > Displayable for SelectionSet < ' a , T > {
7670 fn display ( & self , f : & mut Formatter ) {
7771 f. margin ( ) ;
7872 f. indent ( ) ;
@@ -84,8 +78,7 @@ impl<'a, T: Text<'a>> Displayable for SelectionSet<'a, T>
8478 }
8579}
8680
87- impl < ' a , T : Text < ' a > > Displayable for Selection < ' a , T >
88- {
81+ impl < ' a , T : Text < ' a > > Displayable for Selection < ' a , T > {
8982 fn display ( & self , f : & mut Formatter ) {
9083 match * self {
9184 Selection :: Field ( ref fld) => fld. display ( f) ,
@@ -95,8 +88,7 @@ impl<'a, T: Text<'a>> Displayable for Selection<'a, T>
9588 }
9689}
9790
98- fn format_arguments < ' a , T : Text < ' a > > ( arguments : & [ ( T :: Value , Value < ' a , T > ) ] , f : & mut Formatter )
99- {
91+ fn format_arguments < ' a , T : Text < ' a > > ( arguments : & [ ( T :: Value , Value < ' a , T > ) ] , f : & mut Formatter ) {
10092 if !arguments. is_empty ( ) {
10193 f. start_argument_block ( '(' ) ;
10294 f. start_argument ( ) ;
@@ -114,8 +106,7 @@ fn format_arguments<'a, T: Text<'a>>(arguments: &[(T::Value, Value<'a, T>)], f:
114106 }
115107}
116108
117- impl < ' a , T : Text < ' a > > Displayable for Field < ' a , T >
118- {
109+ impl < ' a , T : Text < ' a > > Displayable for Field < ' a , T > {
119110 fn display ( & self , f : & mut Formatter ) {
120111 f. indent ( ) ;
121112 if let Some ( ref alias) = self . alias {
@@ -138,8 +129,7 @@ impl<'a, T: Text<'a>> Displayable for Field<'a, T>
138129 }
139130}
140131
141- impl < ' a , T : Text < ' a > > Displayable for Query < ' a , T >
142- {
132+ impl < ' a , T : Text < ' a > > Displayable for Query < ' a , T > {
143133 fn display ( & self , f : & mut Formatter ) {
144134 f. margin ( ) ;
145135 f. indent ( ) ;
@@ -167,8 +157,7 @@ impl<'a, T: Text<'a>> Displayable for Query<'a, T>
167157 }
168158}
169159
170- impl < ' a , T : Text < ' a > > Displayable for Mutation < ' a , T >
171- {
160+ impl < ' a , T : Text < ' a > > Displayable for Mutation < ' a , T > {
172161 fn display ( & self , f : & mut Formatter ) {
173162 f. margin ( ) ;
174163 f. indent ( ) ;
@@ -196,8 +185,7 @@ impl<'a, T: Text<'a>> Displayable for Mutation<'a, T>
196185 }
197186}
198187
199- impl < ' a , T : Text < ' a > > Displayable for Subscription < ' a , T >
200- {
188+ impl < ' a , T : Text < ' a > > Displayable for Subscription < ' a , T > {
201189 fn display ( & self , f : & mut Formatter ) {
202190 f. margin ( ) ;
203191 f. indent ( ) ;
@@ -223,8 +211,7 @@ impl<'a, T: Text<'a>> Displayable for Subscription<'a, T>
223211 }
224212}
225213
226- impl < ' a , T : Text < ' a > > Displayable for VariableDefinition < ' a , T >
227- {
214+ impl < ' a , T : Text < ' a > > Displayable for VariableDefinition < ' a , T > {
228215 fn display ( & self , f : & mut Formatter ) {
229216 f. write ( "$" ) ;
230217 f. write ( self . name . as_ref ( ) ) ;
@@ -237,8 +224,7 @@ impl<'a, T: Text<'a>> Displayable for VariableDefinition<'a, T>
237224 }
238225}
239226
240- impl < ' a , T : Text < ' a > > Displayable for Type < ' a , T >
241- {
227+ impl < ' a , T : Text < ' a > > Displayable for Type < ' a , T > {
242228 fn display ( & self , f : & mut Formatter ) {
243229 match * self {
244230 Type :: NamedType ( ref name) => f. write ( name. as_ref ( ) ) ,
@@ -255,8 +241,7 @@ impl<'a, T: Text<'a>> Displayable for Type<'a, T>
255241 }
256242}
257243
258- impl < ' a , T : Text < ' a > > Displayable for Value < ' a , T >
259- {
244+ impl < ' a , T : Text < ' a > > Displayable for Value < ' a , T > {
260245 fn display ( & self , f : & mut Formatter ) {
261246 match * self {
262247 Value :: Variable ( ref name) => {
@@ -303,8 +288,7 @@ impl<'a, T: Text<'a>> Displayable for Value<'a, T>
303288 }
304289}
305290
306- impl < ' a , T : Text < ' a > > Displayable for InlineFragment < ' a , T >
307- {
291+ impl < ' a , T : Text < ' a > > Displayable for InlineFragment < ' a , T > {
308292 fn display ( & self , f : & mut Formatter ) {
309293 f. indent ( ) ;
310294 f. write ( "..." ) ;
@@ -322,8 +306,7 @@ impl<'a, T: Text<'a>> Displayable for InlineFragment<'a, T>
322306 }
323307}
324308
325- impl < ' a , T : Text < ' a > > Displayable for TypeCondition < ' a , T >
326- {
309+ impl < ' a , T : Text < ' a > > Displayable for TypeCondition < ' a , T > {
327310 fn display ( & self , f : & mut Formatter ) {
328311 match * self {
329312 TypeCondition :: On ( ref name) => {
@@ -334,8 +317,7 @@ impl<'a, T: Text<'a>> Displayable for TypeCondition<'a, T>
334317 }
335318}
336319
337- impl < ' a , T : Text < ' a > > Displayable for FragmentSpread < ' a , T >
338- {
320+ impl < ' a , T : Text < ' a > > Displayable for FragmentSpread < ' a , T > {
339321 fn display ( & self , f : & mut Formatter ) {
340322 f. indent ( ) ;
341323 f. write ( "..." ) ;
@@ -345,8 +327,7 @@ impl<'a, T: Text<'a>> Displayable for FragmentSpread<'a, T>
345327 }
346328}
347329
348- impl < ' a , T : Text < ' a > > Displayable for Directive < ' a , T >
349- {
330+ impl < ' a , T : Text < ' a > > Displayable for Directive < ' a , T > {
350331 fn display ( & self , f : & mut Formatter ) {
351332 f. write ( "@" ) ;
352333 f. write ( self . name . as_ref ( ) ) ;
0 commit comments