@@ -128,10 +128,7 @@ impl<T> StableVec<T> {
128128 /// - If `indices[0]` and `indices[1]` refer to the same item, a.k.a. aliasing each other.
129129 /// - If `indices[0]` or `indices[1]` is out of bounds for the arena.
130130 #[ inline]
131- pub fn get_disjoint_mut (
132- & mut self ,
133- indices : [ usize ; 2 ] ,
134- ) -> Result < ( & mut T , & mut T ) , ArenaError > {
131+ pub fn get_disjoint_mut ( & mut self , indices : [ usize ; 2 ] ) -> Result < [ & mut T ; 2 ] , ArenaError > {
135132 let [ a, b] = indices;
136133 if a == b {
137134 return Err ( ArenaError :: AliasingPairAccess ) ;
@@ -146,7 +143,7 @@ impl<T> StableVec<T> {
146143 unsafe {
147144 let pa = self . buckets [ ba] . unwrap_unchecked ( ) . as_ptr ( ) . add ( sa) ;
148145 let pb = self . buckets [ bb] . unwrap_unchecked ( ) . as_ptr ( ) . add ( sb) ;
149- Ok ( ( & mut * pa, & mut * pb) )
146+ Ok ( [ & mut * pa, & mut * pb] )
150147 }
151148 }
152149
@@ -562,7 +559,7 @@ mod tests {
562559 #[ test]
563560 fn get_pair_mut_disjoint ( ) {
564561 let mut vector: StableVec < usize > = ( 0 ..100 ) . collect ( ) ;
565- let ( a, b) = vector. get_disjoint_mut ( [ 10 , 90 ] ) . unwrap ( ) ;
562+ let [ a, b] = vector. get_disjoint_mut ( [ 10 , 90 ] ) . unwrap ( ) ;
566563 * a = 111 ;
567564 * b = 999 ;
568565 assert_eq ! ( vector. get( 10 ) , Some ( & 111 ) ) ;
0 commit comments