File tree Expand file tree Collapse file tree 3 files changed +4
-10
lines changed Expand file tree Collapse file tree 3 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ repository = "https://github.com/graphql-rust/graphql-client"
88
99[dependencies ]
1010failure = " 0.1"
11+ itertools = " 0.8"
1112lazy_static = " 1.0"
1213quote = " 0.6"
1314syn = " 0.15.20"
Original file line number Diff line number Diff line change 99extern crate failure;
1010extern crate graphql_parser;
1111extern crate heck;
12+ extern crate itertools;
1213#[ macro_use]
1314extern crate lazy_static;
1415extern crate proc_macro;
Original file line number Diff line number Diff line change @@ -5,18 +5,10 @@ use objects::GqlObjectField;
55use proc_macro2:: { Ident , Span , TokenStream } ;
66use query:: QueryContext ;
77use selection:: * ;
8+ use itertools:: Itertools ;
89
910fn format_available_fields ( fields : & [ GqlObjectField ] ) -> String {
10- fields
11- . iter ( )
12- . map ( |ref field| & field. name )
13- . fold ( String :: new ( ) , |mut acc, item| {
14- acc. push_str ( item) ;
15- acc. push_str ( ", " ) ;
16- acc
17- } )
18- . trim_end_matches ( ", " )
19- . to_owned ( )
11+ fields. iter ( ) . map ( |ref field| & field. name ) . format ( "`, `" ) . to_string ( )
2012}
2113
2214pub ( crate ) fn render_object_field (
You can’t perform that action at this time.
0 commit comments