Skip to content

Commit de9ba63

Browse files
authored
Merge pull request #194 from h-michael/rust-fmt
execute rustfmt and fix clippy attr
2 parents 1c81278 + 7a1dc67 commit de9ba63

File tree

17 files changed

+75
-52
lines changed

17 files changed

+75
-52
lines changed

graphql_client/examples/github/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type URI = String;
2424
#[graphql(
2525
schema_path = "src/schema.graphql",
2626
query_path = "src/query_1.graphql",
27-
response_derives = "Debug",
27+
response_derives = "Debug"
2828
)]
2929
struct RepoView;
3030

graphql_client/tests/deprecation.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,23 @@ extern crate serde_derive;
88
#[graphql(
99
schema_path = "tests/deprecation/schema.graphql",
1010
query_path = "tests/deprecation/query.graphql",
11-
deprecated = "allow",
11+
deprecated = "allow"
1212
)]
1313
pub struct AllowDeprecation;
1414

1515
#[derive(GraphQLQuery)]
1616
#[graphql(
1717
schema_path = "tests/deprecation/schema.graphql",
1818
query_path = "tests/deprecation/query.graphql",
19-
deprecated = "deny",
19+
deprecated = "deny"
2020
)]
2121
pub struct DenyDeprecation;
2222

2323
#[derive(GraphQLQuery)]
2424
#[graphql(
2525
schema_path = "tests/deprecation/schema.graphql",
2626
query_path = "tests/deprecation/query.graphql",
27-
deprecated = "warn",
27+
deprecated = "warn"
2828
)]
2929
pub struct WarnDeprecation;
3030

graphql_client/tests/input_object_variables.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ extern crate serde_json;
99
#[graphql(
1010
query_path = "tests/input_object_variables/input_object_variables_query.graphql",
1111
schema_path = "tests/input_object_variables/input_object_variables_schema.graphql",
12-
response_derives = "Debug",
12+
response_derives = "Debug"
1313
)]
1414
pub struct InputObjectVariablesQuery;
1515

@@ -34,7 +34,7 @@ type Email = String;
3434
#[graphql(
3535
query_path = "tests/input_object_variables/input_object_variables_query_defaults.graphql",
3636
schema_path = "tests/input_object_variables/input_object_variables_schema.graphql",
37-
response_derives = "Debug",
37+
response_derives = "Debug"
3838
)]
3939
pub struct DefaultInputObjectVariablesQuery;
4040

graphql_client/tests/more_derives.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ extern crate serde_derive;
88
#[graphql(
99
schema_path = "tests/more_derives/schema.graphql",
1010
query_path = "tests/more_derives/query.graphql",
11-
response_derives = "Debug, PartialEq, PartialOrd",
11+
response_derives = "Debug, PartialEq, PartialOrd"
1212
)]
1313
pub struct MoreDerives;
1414

graphql_client/tests/union_query.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const RESPONSE: &'static str = include_str!("unions/union_query_response.json");
1111
#[graphql(
1212
query_path = "tests/unions/union_query.graphql",
1313
schema_path = "tests/unions/union_schema.graphql",
14-
response_derives = "PartialEq, Debug",
14+
response_derives = "PartialEq, Debug"
1515
)]
1616
pub struct UnionQuery;
1717

graphql_client_cli/src/generate.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::io::Write as IoWrite;
55
use std::path::PathBuf;
66
use syn;
77

8-
#[allow(too_many_arguments)]
8+
#[allow(clippy::too_many_arguments)]
99
pub fn generate_code(
1010
query_path: PathBuf,
1111
schema_path: PathBuf,
@@ -29,11 +29,13 @@ pub fn generate_code(
2929
let module_visibility = match module_visibility {
3030
Some("pub") => syn::VisPublic {
3131
pub_token: <Token![pub]>::default(),
32-
}.into(),
32+
}
33+
.into(),
3334
Some("private") => syn::Visibility::Inherited {},
3435
_ => syn::VisPublic {
3536
pub_token: <Token![pub]>::default(),
36-
}.into(),
37+
}
38+
.into(),
3739
};
3840

3941
let options = GraphQLClientDeriveOptions {

graphql_client_codegen/src/codegen.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ pub fn response_for_query(
116116
} else {
117117
None
118118
}
119-
}).collect();
119+
})
120+
.collect();
120121
let fragment_definitions = fragment_definitions?;
121122
let variables_struct =
122123
operation.expand_variables(&context, &operation.name, multiple_operation);
@@ -131,7 +132,8 @@ pub fn response_for_query(
131132
} else {
132133
None
133134
}
134-
}).collect();
135+
})
136+
.collect();
135137
let input_object_definitions = input_object_definitions?;
136138

137139
let scalar_definitions: Vec<TokenStream> = context
@@ -144,7 +146,8 @@ pub fn response_for_query(
144146
} else {
145147
None
146148
}
147-
}).collect();
149+
})
150+
.collect();
148151

149152
let response_derives = context.response_derives();
150153

graphql_client_codegen/src/enums.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ impl GqlEnum {
2828
let description = &v.description;
2929
let description = description.as_ref().map(|d| quote!(#[doc = #d]));
3030
quote!(#description #name)
31-
}).collect();
31+
})
32+
.collect();
3233
let variant_names = &variant_names;
3334
let name_ident = Ident::new(&format!("{}{}", ENUMS_PREFIX, self.name), Span::call_site());
3435
let constructors: Vec<_> = self
@@ -37,7 +38,8 @@ impl GqlEnum {
3738
.map(|v| {
3839
let v = Ident::new(&v.name, Span::call_site());
3940
quote!(#name_ident::#v)
40-
}).collect();
41+
})
42+
.collect();
4143
let constructors = &constructors;
4244
let variant_str: Vec<&str> = self.variants.iter().map(|v| v.name.as_str()).collect();
4345
let variant_str = &variant_str;

graphql_client_codegen/src/fragments.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ impl GqlFragment {
4141
);
4242
};
4343

44-
Ok(quote!{
44+
Ok(quote! {
4545
#derives
4646
pub struct #name_ident {
4747
#(#fields,)*

graphql_client_codegen/src/inputs.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ impl ::std::convert::From<graphql_parser::schema::InputObjectType> for GqlInput
7272
deprecation: DeprecationStatus::Current,
7373
};
7474
(name, field)
75-
}).collect(),
75+
})
76+
.collect(),
7677
is_required: false.into(),
7778
}
7879
}
@@ -101,7 +102,8 @@ impl ::std::convert::From<introspection_response::FullType> for GqlInput {
101102
deprecation: DeprecationStatus::Current,
102103
};
103104
(name, field)
104-
}).collect(),
105+
})
106+
.collect(),
105107
is_required: false.into(),
106108
}
107109
}
@@ -148,7 +150,8 @@ mod tests {
148150
deprecation: DeprecationStatus::Current,
149151
},
150152
),
151-
].into_iter()
153+
]
154+
.into_iter()
152155
.collect(),
153156
is_required: false.into(),
154157
};
@@ -161,7 +164,8 @@ mod tests {
161164
"pub paws_count : Float , ",
162165
"pub requirements : Option < CatRequirements > , ",
163166
"}",
164-
].into_iter()
167+
]
168+
.into_iter()
165169
.collect();
166170

167171
let mut context = QueryContext::new_empty();

0 commit comments

Comments
 (0)