File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ pub struct Directory {
71
71
/// Maps file indicies to indicies for the `curr_image_idx`.
72
72
/// This is relevant when the current image is given by its name
73
73
/// when it will first be located by its file index.
74
- file_i_to_img_i : Vec < Option < u32 > > ,
74
+ file_i_to_img_i : Vec < Option < usize > > ,
75
75
76
76
/// A monotonically increasing integer used for identifying
77
77
/// each load request
@@ -331,15 +331,15 @@ impl Directory {
331
331
for _ in ( last_file_i + 1 ) as usize ..curr_file_i {
332
332
self . file_i_to_img_i . push ( None ) ;
333
333
}
334
- self . file_i_to_img_i . push ( Some ( curr_img_i as u32 ) ) ;
334
+ self . file_i_to_img_i . push ( Some ( curr_img_i) ) ;
335
335
last_file_i = curr_file_i as isize ;
336
336
}
337
337
self . set_image_index_from_file_index ( ) ;
338
338
}
339
339
340
340
fn set_image_index_from_file_index ( & mut self ) {
341
- if let Some ( img_idx) = self . file_i_to_img_i . get ( self . curr_file_idx ) {
342
- self . curr_image_idx = img_idx. unwrap ( ) as usize ;
341
+ if let Some ( Some ( img_idx) ) = self . file_i_to_img_i . get ( self . curr_file_idx ) {
342
+ self . curr_image_idx = * img_idx;
343
343
}
344
344
}
345
345
You can’t perform that action at this time.
0 commit comments