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"
8
8
9
9
[dependencies ]
10
10
failure = " 0.1"
11
+ itertools = " 0.8"
11
12
lazy_static = " 1.0"
12
13
quote = " 0.6"
13
14
syn = " 0.15.20"
Original file line number Diff line number Diff line change 9
9
extern crate failure;
10
10
extern crate graphql_parser;
11
11
extern crate heck;
12
+ extern crate itertools;
12
13
#[ macro_use]
13
14
extern crate lazy_static;
14
15
extern crate proc_macro;
Original file line number Diff line number Diff line change @@ -5,18 +5,10 @@ use objects::GqlObjectField;
5
5
use proc_macro2:: { Ident , Span , TokenStream } ;
6
6
use query:: QueryContext ;
7
7
use selection:: * ;
8
+ use itertools:: Itertools ;
8
9
9
10
fn 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 ( )
20
12
}
21
13
22
14
pub ( crate ) fn render_object_field (
You can’t perform that action at this time.
0 commit comments