File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed
graphql_client_codegen/src Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,12 @@ pub enum DeprecationStrategy {
17
17
Warn ,
18
18
}
19
19
20
+ impl Default for DeprecationStrategy {
21
+ fn default ( ) -> Self {
22
+ DeprecationStrategy :: Warn
23
+ }
24
+ }
25
+
20
26
pub fn extract_deprecation_strategy (
21
27
ast : & syn:: DeriveInput ,
22
28
) -> Result < DeprecationStrategy , failure:: Error > {
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ pub fn generate_module_token_stream(
78
78
// The user can determine what to do about deprecations.
79
79
let deprecation_strategy = options
80
80
. deprecation_strategy
81
- . unwrap_or ( deprecation:: DeprecationStrategy :: Warn ) ;
81
+ . unwrap_or ( deprecation:: DeprecationStrategy :: default ( ) ) ;
82
82
83
83
// We need to qualify the query with the path to the crate it is part of
84
84
let ( query_string, query) = {
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ fn build_graphql_client_derive_options(input: &syn::DeriveInput) -> GraphQLClien
34
34
let response_derives = attributes:: extract_attr ( input, "response_derives" ) . ok ( ) ;
35
35
// The user can determine what to do about deprecations.
36
36
let deprecation_strategy = deprecation:: extract_deprecation_strategy ( input)
37
- . unwrap_or ( deprecation:: DeprecationStrategy :: Warn ) ;
37
+ . unwrap_or ( deprecation:: DeprecationStrategy :: default ( ) ) ;
38
38
39
39
GraphQLClientDeriveOptions {
40
40
selected_operation : input. ident . to_string ( ) ,
You can’t perform that action at this time.
0 commit comments