File tree 3 files changed +8
-4
lines changed
3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -16,8 +16,12 @@ use uefi::Error;
16
16
/// - return a mutable typed reference (which points to the same memory as the input buffer) on
17
17
/// success, and
18
18
/// - return the required buffer size on error.
19
- pub fn make_boxed < ' a , Data : Align + ?Sized + Debug + ' a > (
20
- mut fetch_data_fn : impl FnMut ( & ' a mut [ u8 ] ) -> Result < & ' a mut Data , Option < usize > > ,
19
+ pub fn make_boxed <
20
+ ' a ,
21
+ Data : Align + ?Sized + Debug + ' a ,
22
+ F : FnMut ( & ' a mut [ u8 ] ) -> Result < & ' a mut Data , Option < usize > > ,
23
+ > (
24
+ mut fetch_data_fn : F ,
21
25
) -> Result < Box < Data > > {
22
26
let required_size = match fetch_data_fn ( & mut [ ] ) . map_err ( Error :: split) {
23
27
// This is the expected case: the empty buffer passed in is too
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ impl Directory {
77
77
maybe_info. expect ( "Should have more entries" )
78
78
} )
79
79
} ;
80
- let file_info = make_boxed :: < FileInfo > ( fetch_data_fn) ?;
80
+ let file_info = make_boxed :: < FileInfo , _ > ( fetch_data_fn) ?;
81
81
Ok ( Some ( file_info) )
82
82
}
83
83
Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ pub trait File: Sized {
165
165
/// Get the dynamically allocated info for a file
166
166
fn get_boxed_info < Info : FileProtocolInfo + ?Sized + Debug > ( & mut self ) -> Result < Box < Info > > {
167
167
let fetch_data_fn = |buf| self . get_info :: < Info > ( buf) ;
168
- let file_info = make_boxed :: < Info > ( fetch_data_fn) ?;
168
+ let file_info = make_boxed :: < Info , _ > ( fetch_data_fn) ?;
169
169
Ok ( file_info)
170
170
}
171
171
You can’t perform that action at this time.
0 commit comments