File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
10
10
- The ` variables_derives ` now trims whitespace from individual derivation traits.
11
11
- The new ` reqwest-rustls ` feature works like the ` reqwest ` feature but with
12
12
` rustls ` rather than ` native-tls ` .
13
+ - Code generated by the ` graphql-client ` CLI program now suppresses all
14
+ warnings from rustc and clippy.
13
15
14
16
## 0.10.0 - 2021-07-04
15
17
Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ pub(crate) struct CliCodegenParams {
24
24
pub fragments_other_variant : bool ,
25
25
}
26
26
27
+ const WARNING_SUPPRESSION : & str = "#![allow(clippy::all, warnings)]" ;
28
+
27
29
pub ( crate ) fn generate_code ( params : CliCodegenParams ) -> CliResult < ( ) > {
28
30
let CliCodegenParams {
29
31
variables_derives,
@@ -78,7 +80,7 @@ pub(crate) fn generate_code(params: CliCodegenParams) -> CliResult<()> {
78
80
let gen = generate_module_token_stream ( query_path. clone ( ) , & schema_path, options)
79
81
. map_err ( |err| Error :: message ( format ! ( "Error generating module code: {}" , err) ) ) ?;
80
82
81
- let generated_code = gen . to_string ( ) ;
83
+ let generated_code = format ! ( "{} \n {}" , WARNING_SUPPRESSION , gen ) ;
82
84
let generated_code = if !no_formatting {
83
85
format ( & generated_code) ?
84
86
} else {
You can’t perform that action at this time.
0 commit comments