We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 685c937 commit 9fbe687Copy full SHA for 9fbe687
uefi/src/mem.rs
@@ -16,8 +16,12 @@ use uefi::Error;
16
/// - return a mutable typed reference (which points to the same memory as the input buffer) on
17
/// success, and
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>>,
+pub fn make_boxed<
+ '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,
25
) -> Result<Box<Data>> {
26
let required_size = match fetch_data_fn(&mut []).map_err(Error::split) {
27
// This is the expected case: the empty buffer passed in is too
uefi/src/proto/media/file/dir.rs
@@ -77,7 +77,7 @@ impl Directory {
77
maybe_info.expect("Should have more entries")
78
})
79
};
80
- let file_info = make_boxed::<FileInfo>(fetch_data_fn)?;
+ let file_info = make_boxed::<FileInfo,_>(fetch_data_fn)?;
81
Ok(Some(file_info))
82
}
83
uefi/src/proto/media/file/mod.rs
@@ -165,7 +165,7 @@ pub trait File: Sized {
165
/// Get the dynamically allocated info for a file
166
fn get_boxed_info<Info: FileProtocolInfo + ?Sized + Debug>(&mut self) -> Result<Box<Info>> {
167
let fetch_data_fn = |buf| self.get_info::<Info>(buf);
168
- let file_info = make_boxed::<Info>(fetch_data_fn)?;
+ let file_info = make_boxed::<Info,_>(fetch_data_fn)?;
169
Ok(file_info)
170
171
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments