File tree 1 file changed +11
-12
lines changed 1 file changed +11
-12
lines changed Original file line number Diff line number Diff line change 3
3
mod particles;
4
4
use self :: particles:: { Particle , ParticleVec } ;
5
5
use soa_derive:: StructOfArray ;
6
+ use std:: { cell:: Cell , rc:: Rc } ;
6
7
7
8
#[ test]
8
9
fn ty ( ) {
@@ -162,21 +163,19 @@ fn retain() {
162
163
assert_eq ! ( particles. index( 1 ) . name, "C" ) ;
163
164
}
164
165
165
- #[ test]
166
- fn drop_vec ( ) {
167
- use std:: { cell:: Cell , rc:: Rc } ;
168
-
169
- #[ derive( StructOfArray ) ]
170
- struct IncrOnDrop {
171
- cell : Rc < Cell < usize > > ,
172
- }
166
+ #[ derive( StructOfArray ) ]
167
+ struct IncrOnDrop {
168
+ cell : Rc < Cell < usize > > ,
169
+ }
173
170
174
- impl Drop for IncrOnDrop {
175
- fn drop ( & mut self ) {
176
- self . cell . set ( self . cell . get ( ) + 1 ) ;
177
- }
171
+ impl Drop for IncrOnDrop {
172
+ fn drop ( & mut self ) {
173
+ self . cell . set ( self . cell . get ( ) + 1 ) ;
178
174
}
175
+ }
179
176
177
+ #[ test]
178
+ fn drop_vec ( ) {
180
179
let counter = Rc :: new ( Cell :: default ( ) ) ;
181
180
let mut vec = IncrOnDropVec :: new ( ) ;
182
181
for _ in 0 ..5 {
You can’t perform that action at this time.
0 commit comments