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 {
1717 Warn ,
1818}
1919
20+ impl Default for DeprecationStrategy {
21+ fn default ( ) -> Self {
22+ DeprecationStrategy :: Warn
23+ }
24+ }
25+
2026pub fn extract_deprecation_strategy (
2127 ast : & syn:: DeriveInput ,
2228) -> Result < DeprecationStrategy , failure:: Error > {
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ pub fn generate_module_token_stream(
7878 // The user can determine what to do about deprecations.
7979 let deprecation_strategy = options
8080 . deprecation_strategy
81- . unwrap_or ( deprecation:: DeprecationStrategy :: Warn ) ;
81+ . unwrap_or ( deprecation:: DeprecationStrategy :: default ( ) ) ;
8282
8383 // We need to qualify the query with the path to the crate it is part of
8484 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
3434 let response_derives = attributes:: extract_attr ( input, "response_derives" ) . ok ( ) ;
3535 // The user can determine what to do about deprecations.
3636 let deprecation_strategy = deprecation:: extract_deprecation_strategy ( input)
37- . unwrap_or ( deprecation:: DeprecationStrategy :: Warn ) ;
37+ . unwrap_or ( deprecation:: DeprecationStrategy :: default ( ) ) ;
3838
3939 GraphQLClientDeriveOptions {
4040 selected_operation : input. ident . to_string ( ) ,
You can’t perform that action at this time.
0 commit comments