File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -193,20 +193,17 @@ impl<'a> Struct<'a> {
193193
194194 /// Assemble the `derive` attribute for the struct
195195 fn attr_derive ( & self ) -> String {
196- let mut derives_vec = if self . config . options . additional_derives . is_empty ( ) {
197- Vec :: with_capacity ( 10 )
198- } else {
199- let mut _derives_vec =
200- Vec :: < & str > :: with_capacity ( 10 + self . config . options . additional_derives . len ( ) ) ;
201- _derives_vec. extend (
196+ let mut derives_vec =
197+ Vec :: < & str > :: with_capacity ( 10 + self . config . options . additional_derives . len ( ) ) ;
198+ if !self . config . options . additional_derives . is_empty ( ) {
199+ derives_vec. extend (
202200 self . config
203201 . options
204202 . additional_derives
205203 . iter ( )
206204 . map ( |s| -> & str { s. as_ref ( ) } ) ,
207205 ) ;
208- _derives_vec
209- } ;
206+ }
210207 // Default derives that exist on every struct
211208 derives_vec. extend_from_slice ( & [ derives:: DEBUG , derives:: CLONE ] ) ;
212209
You can’t perform that action at this time.
0 commit comments