Commit 16e4c9a 1 parent dcb58b0 commit 16e4c9a Copy full SHA for 16e4c9a
File tree 1 file changed +9
-15
lines changed
sqlx-macros-core/src/derives
1 file changed +9
-15
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ fn expand_derive_has_sql_type_transparent(
77
77
. push ( parse_quote ! ( #ty: :: sqlx:: postgres:: PgHasArrayType ) ) ;
78
78
let ( array_impl_generics, _, array_where_clause) = array_generics. split_for_impl ( ) ;
79
79
80
- let mut tokens = quote ! (
80
+ return Ok ( quote ! (
81
81
#[ automatically_derived]
82
82
impl #impl_generics :: sqlx:: Type < DB > for #ident #ty_generics #where_clause {
83
83
fn type_info( ) -> DB :: TypeInfo {
@@ -88,21 +88,15 @@ fn expand_derive_has_sql_type_transparent(
88
88
<#ty as :: sqlx:: Type <DB >>:: compatible( ty)
89
89
}
90
90
}
91
- ) ;
92
-
93
- if cfg ! ( feature = "postgres" ) {
94
- tokens. extend ( quote ! (
95
- #[ automatically_derived]
96
- impl #array_impl_generics :: sqlx:: postgres:: PgHasArrayType for #ident #ty_generics
97
- #array_where_clause {
98
- fn array_type_info( ) -> :: sqlx:: postgres:: PgTypeInfo {
99
- <#ty as :: sqlx:: postgres:: PgHasArrayType >:: array_type_info( )
100
- }
91
+ #[ automatically_derived]
92
+ #[ cfg( feature = "postgres" ) ]
93
+ impl #array_impl_generics :: sqlx:: postgres:: PgHasArrayType for #ident #ty_generics
94
+ #array_where_clause {
95
+ fn array_type_info( ) -> :: sqlx:: postgres:: PgTypeInfo {
96
+ <#ty as :: sqlx:: postgres:: PgHasArrayType >:: array_type_info( )
101
97
}
102
- ) ) ;
103
- }
104
-
105
- return Ok ( tokens) ;
98
+ }
99
+ ) ) ;
106
100
}
107
101
108
102
let mut tts = TokenStream :: new ( ) ;
You can’t perform that action at this time.
0 commit comments