@@ -501,13 +501,9 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
501
501
let & [ _, _] = check_arg_count ( args) ?;
502
502
if let Some ( file_descriptor) = this. machine . file_handler . handles . get ( & fd) {
503
503
// FIXME: Support fullfsync for all FDs
504
- match file_descriptor. as_file_handle ( ) {
505
- Ok ( FileHandle { file, writable } ) => {
506
- let io_result = maybe_sync_file ( & file, * writable, File :: sync_all) ;
507
- this. try_unwrap_io_result ( io_result)
508
- } ,
509
- Err ( _) => this. handle_not_found ( ) ,
510
- }
504
+ let FileHandle { file, writable } = file_descriptor. as_file_handle ( ) ?;
505
+ let io_result = maybe_sync_file ( & file, * writable, File :: sync_all) ;
506
+ this. try_unwrap_io_result ( io_result)
511
507
} else {
512
508
this. handle_not_found ( )
513
509
}
@@ -1365,10 +1361,7 @@ impl FileMetadata {
1365
1361
) -> InterpResult < ' tcx , Option < FileMetadata > > {
1366
1362
let option = ecx. machine . file_handler . handles . get ( & fd) ;
1367
1363
let file = match option {
1368
- Some ( file_descriptor) => {
1369
- let FileHandle { file, writable : _ } = file_descriptor. as_file_handle ( ) ?;
1370
- file
1371
- } ,
1364
+ Some ( file_descriptor) => & file_descriptor. as_file_handle ( ) ?. file ,
1372
1365
None => return ecx. handle_not_found ( ) . map ( |_: i32 | None ) ,
1373
1366
} ;
1374
1367
let metadata = file. metadata ( ) ;
0 commit comments