File tree Expand file tree Collapse file tree 2 files changed +1
-13
lines changed Expand file tree Collapse file tree 2 files changed +1
-13
lines changed Original file line number Diff line number Diff line change @@ -39,11 +39,6 @@ pub fn derive(input: &Input) -> TokenStream {
39
39
|_, field_type| quote ! { Vec <#field_type> } ,
40
40
) . collect :: < Vec < _ > > ( ) ;
41
41
42
- let vec_new = input. map_fields_nested_or (
43
- |_, field_type| quote ! { <#field_type as StructOfArray >:: Type :: new( ) } ,
44
- |_, _| quote ! { Vec :: new( ) } ,
45
- ) . collect :: < Vec < _ > > ( ) ;
46
-
47
42
let vec_with_capacity = input. map_fields_nested_or (
48
43
|_, field_type| quote ! { <#field_type as StructOfArray >:: Type :: with_capacity( capacity) } ,
49
44
|_, _| quote ! { Vec :: with_capacity( capacity) } ,
@@ -96,9 +91,7 @@ pub fn derive(input: &Input) -> TokenStream {
96
91
#[ doc = #vec_name_str]
97
92
/// ::new()`](https://doc.rust-lang.org/std/vec/struct.Vec.html#method.new)
98
93
pub fn new( ) -> #vec_name {
99
- #vec_name {
100
- #( #fields_names: #vec_new, ) *
101
- }
94
+ Default :: default ( )
102
95
}
103
96
104
97
/// Similar to [`
Original file line number Diff line number Diff line change @@ -10,11 +10,6 @@ fn ty() {
10
10
let _: <Particle as StructOfArray >:: Type = ParticleVec :: new ( ) ;
11
11
}
12
12
13
- #[ test]
14
- fn default ( ) {
15
- assert_eq ! ( ParticleVec :: new( ) , ParticleVec :: default ( ) ) ;
16
- }
17
-
18
13
#[ test]
19
14
fn push ( ) {
20
15
let mut particles = ParticleVec :: new ( ) ;
You can’t perform that action at this time.
0 commit comments