Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9fbe687

Browse files
committed
make_boxed: prevent 'explicit_generic_args_with_impl_trait' due to MSRV
1 parent 685c937 commit 9fbe687

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

‎uefi/src/mem.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@ use uefi::Error;
1616
/// - return a mutable typed reference (which points to the same memory as the input buffer) on
1717
/// success, and
1818
/// - 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,
2125
) -> Result<Box<Data>> {
2226
let required_size = match fetch_data_fn(&mut []).map_err(Error::split) {
2327
// This is the expected case: the empty buffer passed in is too

‎uefi/src/proto/media/file/dir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl Directory {
7777
maybe_info.expect("Should have more entries")
7878
})
7979
};
80-
let file_info = make_boxed::<FileInfo>(fetch_data_fn)?;
80+
let file_info = make_boxed::<FileInfo,_>(fetch_data_fn)?;
8181
Ok(Some(file_info))
8282
}
8383

‎uefi/src/proto/media/file/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ pub trait File: Sized {
165165
/// Get the dynamically allocated info for a file
166166
fn get_boxed_info<Info: FileProtocolInfo + ?Sized + Debug>(&mut self) -> Result<Box<Info>> {
167167
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)?;
169169
Ok(file_info)
170170
}
171171

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /