@@ -44,7 +44,7 @@ DBVT<B, BV> {
44
44
pub fn remove ( & mut self , leaf : & mut Rc < RefCell < DBVTLeaf < B , BV > > > ) {
45
45
let self_tree = self . tree . take ( ) . unwrap ( ) ;
46
46
47
- let mut bleaf = leaf. borrow_mut ( ) ;
47
+ let mut bleaf = ( * leaf) . borrow_mut ( ) ;
48
48
self . tree = bleaf. unlink ( & mut self . cache , self_tree) ;
49
49
self . len = self . len - 1 ;
50
50
}
@@ -267,9 +267,7 @@ impl<B: 'static, BV: Translation<Vect> + 'static> DBVTLeaf<B, BV> {
267
267
match other {
268
268
Internal ( ref mut i) => i. parent = pp,
269
269
Leaf ( ref mut l) => {
270
- // FIXME: if deref_mut is not called, the type inference seems to be
271
- // buggy
272
- l. borrow_mut ( ) . deref_mut ( ) . parent =
270
+ ( * * l) . borrow_mut ( ) . parent =
273
271
if is_p_right_to_pp { RightChildOf ( pp) } else { LeftChildOf ( pp) }
274
272
} ,
275
273
Invalid => unreachable ! ( )
@@ -295,9 +293,7 @@ impl<B: 'static, BV: Translation<Vect> + 'static> DBVTLeaf<B, BV> {
295
293
// the root changes to the other child
296
294
match other {
297
295
Internal ( ref mut i) => i. parent = ptr:: null_mut ( ) ,
298
- // FIXME: if deref_mut is not called, the type inference seems to be
299
- // buggy
300
- Leaf ( ref l) => l. borrow_mut ( ) . deref_mut ( ) . parent = Detached ,
296
+ Leaf ( ref l) => ( * * l) . borrow_mut ( ) . parent = Detached ,
301
297
Invalid => unreachable ! ( )
302
298
}
303
299
@@ -367,7 +363,7 @@ impl<BV: 'static + BoundingVolume + Translation<Vect> + Clone, B: 'static + Clon
367
363
to_insert : Rc < RefCell < DBVTLeaf < B , BV > > > )
368
364
-> Box < DBVTInternal < B , BV > > {
369
365
370
- let mut bto_insert = to_insert. borrow_mut ( ) ;
366
+ let mut bto_insert = ( * to_insert) . borrow_mut ( ) ;
371
367
let pto_insert = bto_insert. deref_mut ( ) ;
372
368
373
369
match self {
@@ -415,7 +411,7 @@ impl<BV: 'static + BoundingVolume + Translation<Vect> + Clone, B: 'static + Clon
415
411
parent = & mut * * ci as * mut DBVTInternal < B , BV > ;
416
412
} ,
417
413
Leaf ( ref l) => {
418
- let mut bl = l . borrow_mut ( ) ;
414
+ let mut bl = ( * * l ) . borrow_mut ( ) ;
419
415
let pl = bl. deref_mut ( ) ;
420
416
let mut internal = cache. alloc ( DBVTInternal :: new (
421
417
pl. bounding_volume . merged ( & pto_insert. bounding_volume ) ,
@@ -444,7 +440,7 @@ impl<BV: 'static + BoundingVolume + Translation<Vect> + Clone, B: 'static + Clon
444
440
} ,
445
441
Leaf ( l) => {
446
442
let cl = l. clone ( ) ;
447
- let mut bl = cl . borrow_mut ( ) ;
443
+ let mut bl = ( * cl ) . borrow_mut ( ) ;
448
444
let pl = bl. deref_mut ( ) ;
449
445
450
446
// create the root
0 commit comments