File tree 1 file changed +14
-12
lines changed
xml_schema_derive/src/xsd
1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -147,17 +147,6 @@ impl Element {
147
147
rust_type
148
148
} ;
149
149
150
- let rust_type = if optional || ( !multiple && self . min_occurences == Some ( 0 ) ) {
151
- quote ! ( Option <#rust_type>)
152
- } else {
153
- rust_type
154
- } ;
155
-
156
- let prefix_attribute = prefix
157
- . as_ref ( )
158
- . map ( |prefix| quote ! ( , prefix=#prefix) )
159
- . unwrap_or_default ( ) ;
160
-
161
150
let module = ( !context. is_in_sub_module ( )
162
151
&& !self
163
152
. kind
@@ -170,9 +159,22 @@ impl Element {
170
159
. then_some ( quote ! ( xml_schema_types:: ) )
171
160
. unwrap_or_default ( ) ;
172
161
162
+ let rust_type = quote ! ( #module#rust_type) ;
163
+
164
+ let rust_type = if optional || ( !multiple && self . min_occurences == Some ( 0 ) ) {
165
+ quote ! ( Option <#rust_type>)
166
+ } else {
167
+ rust_type
168
+ } ;
169
+
170
+ let prefix_attribute = prefix
171
+ . as_ref ( )
172
+ . map ( |prefix| quote ! ( , prefix=#prefix) )
173
+ . unwrap_or_default ( ) ;
174
+
173
175
quote ! {
174
176
#[ yaserde( rename=#yaserde_rename #prefix_attribute) ]
175
- pub #attribute_name: #module# rust_type,
177
+ pub #attribute_name: #rust_type,
176
178
}
177
179
}
178
180
}
You can’t perform that action at this time.
0 commit comments