@@ -63,7 +63,7 @@ impl FileSystem {
63
63
let mut src = self
64
64
. open ( src_path, UefiFileMode :: Read , false ) ?
65
65
. into_regular_file ( )
66
- . ok_or ( Error :: Io ( IoError {
66
+ . ok_or_else ( || Error :: Io ( IoError {
67
67
path : src_path. to_path_buf ( ) ,
68
68
context : IoErrorContext :: NotAFile ,
69
69
uefi_error : Status :: INVALID_PARAMETER . into ( ) ,
@@ -91,7 +91,7 @@ impl FileSystem {
91
91
let mut dest = self
92
92
. open ( dest_path, UefiFileMode :: CreateReadWrite , false ) ?
93
93
. into_regular_file ( )
94
- . ok_or ( Error :: Io ( IoError {
94
+ . ok_or_else ( || Error :: Io ( IoError {
95
95
path : dest_path. to_path_buf ( ) ,
96
96
context : IoErrorContext :: OpenError ,
97
97
uefi_error : Status :: INVALID_PARAMETER . into ( ) ,
@@ -198,7 +198,7 @@ impl FileSystem {
198
198
let mut file = self
199
199
. open ( path, UefiFileMode :: Read , false ) ?
200
200
. into_regular_file ( )
201
- . ok_or ( Error :: Io ( IoError {
201
+ . ok_or_else ( || Error :: Io ( IoError {
202
202
path : path. to_path_buf ( ) ,
203
203
context : IoErrorContext :: NotAFile ,
204
204
// We do not have a real UEFI error here as we have a logical
@@ -237,7 +237,7 @@ impl FileSystem {
237
237
let dir = self
238
238
. open ( path, UefiFileMode :: Read , false ) ?
239
239
. into_directory ( )
240
- . ok_or ( Error :: Io ( IoError {
240
+ . ok_or_else ( || Error :: Io ( IoError {
241
241
path : path. to_path_buf ( ) ,
242
242
context : IoErrorContext :: NotADirectory ,
243
243
// We do not have a real UEFI error here as we have a logical
0 commit comments