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.
1010- The ` variables_derives ` now trims whitespace from individual derivation traits.
1111- The new ` reqwest-rustls ` feature works like the ` reqwest ` feature but with
1212 ` rustls ` rather than ` native-tls ` .
13+ - Code generated by the ` graphql-client ` CLI program now suppresses all
14+ warnings from rustc and clippy.
1315
1416## 0.10.0 - 2021-07-04
1517
Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ pub(crate) struct CliCodegenParams {
2424 pub fragments_other_variant : bool ,
2525}
2626
27+ const WARNING_SUPPRESSION : & str = "#![allow(clippy::all, warnings)]" ;
28+
2729pub ( crate ) fn generate_code ( params : CliCodegenParams ) -> CliResult < ( ) > {
2830 let CliCodegenParams {
2931 variables_derives,
@@ -78,7 +80,7 @@ pub(crate) fn generate_code(params: CliCodegenParams) -> CliResult<()> {
7880 let gen = generate_module_token_stream ( query_path. clone ( ) , & schema_path, options)
7981 . map_err ( |err| Error :: message ( format ! ( "Error generating module code: {}" , err) ) ) ?;
8082
81- let generated_code = gen . to_string ( ) ;
83+ let generated_code = format ! ( "{} \n {}" , WARNING_SUPPRESSION , gen ) ;
8284 let generated_code = if !no_formatting {
8385 format ( & generated_code) ?
8486 } else {
You can’t perform that action at this time.
0 commit comments