@@ -193,10 +193,18 @@ impl MoveData {
193
193
self . paths [ * index] . next_sibling
194
194
}
195
195
196
- fn mut_path < ' a > ( & ' a mut self , index : MovePathIndex ) -> & ' a mut MovePath {
197
- //! Type safe indexing operator
198
- & mut self . paths [ * index]
196
+ fn set_path_first_move ( & mut self ,
197
+ index : MovePathIndex ,
198
+ first_move : MoveIndex ) {
199
+ self . paths [ * index] . first_move = first_move
200
+ }
201
+
202
+ fn set_path_first_child ( & mut self ,
203
+ index : MovePathIndex ,
204
+ first_child : MovePathIndex ) {
205
+ self . paths [ * index] . first_child = first_child
199
206
}
207
+
200
208
201
209
fn move < ' a > ( & ' a self , index : MoveIndex ) -> & ' a Move {
202
210
//! Type safe indexing operator
@@ -244,7 +252,7 @@ impl MoveData {
244
252
let index = MovePathIndex ( self . paths . len ( ) ) ;
245
253
246
254
let next_sibling = self . path_first_child ( parent_index) ;
247
- self . mut_path ( parent_index) . first_child = index;
255
+ self . set_path_first_child ( parent_index, index) ;
248
256
249
257
self . paths . push ( MovePath {
250
258
loan_path : lp,
@@ -327,7 +335,7 @@ impl MoveData {
327
335
let move_index = MoveIndex ( self . moves . len ( ) ) ;
328
336
329
337
let next_move = self . path_first_move ( path_index) ;
330
- self . mut_path ( path_index) . first_move = move_index;
338
+ self . set_path_first_move ( path_index, move_index) ;
331
339
332
340
self . moves . push ( Move {
333
341
path : path_index,
0 commit comments