Skip to content

Commit f76876b

Browse files
authored
Merge pull request #1871 from rust-osdev/bishop-msrv-188
Bump MSRV to 1.88
2 parents 21db13e + 12310f0 commit f76876b

8 files changed

Lines changed: 14 additions & 13 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ edition = "2024"
1717
keywords = ["uefi", "efi"]
1818
license = "MIT OR Apache-2.0"
1919
repository = "https://github.com/rust-osdev/uefi-rs"
20-
rust-version = "1.85.1"
20+
rust-version = "1.88"
2121

2222
[workspace.dependencies]
2323
bitflags = "2.0.0"

uefi/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
Option.
2323
- **Breaking:** `boot::check_event` now consumes `&Event` rather than `Event`, removing the
2424
need for unnecessary `Event::unsafe_clone()`s.
25+
- MSRV increased to 1.88.
2526

2627
# uefi - v0.36.1 (2025-11-05)
2728

uefi/src/allocator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ fn alloc_pool_aligned(memory_type: MemoryType, size: usize, align: usize) -> *mu
8787
///
8888
/// [Rust type layout]: https://doc.rust-lang.org/reference/type-layout.html
8989
const fn layout_allows_page_alloc_shortcut(layout: &Layout) -> bool {
90-
layout.size() % PAGE_SIZE == 0 && layout.align() == PAGE_SIZE
90+
layout.size().is_multiple_of(PAGE_SIZE) && layout.align() == PAGE_SIZE
9191
}
9292

9393
/// Allocator using UEFI boot services.

uefi/src/data_types/owned_strs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,13 @@ impl CString16 {
101101

102102
/// Returns the number of characters without the trailing null character.
103103
#[must_use]
104-
pub fn num_chars(&self) -> usize {
104+
pub const fn num_chars(&self) -> usize {
105105
self.0.len() - 1
106106
}
107107

108108
/// Returns if the string is empty. This ignores the null character.
109109
#[must_use]
110-
pub fn is_empty(&self) -> bool {
110+
pub const fn is_empty(&self) -> bool {
111111
self.num_chars() == 0
112112
}
113113
}

uefi/src/mem/aligned_buffer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ impl AlignedBuffer {
100100
/// Check the buffer's alignment against the `required_alignment`.
101101
pub fn check_alignment(&self, required_alignment: usize) -> Result<(), AlignmentError> {
102102
//TODO: use bfr.addr() when it's available
103-
if (self.ptr() as usize) % required_alignment != 0 {
103+
if !(self.ptr() as usize).is_multiple_of(required_alignment) {
104104
return Err(AlignmentError); //TODO: use >is_aligned_to< when it's available
105105
}
106106
Ok(())

uefi/src/proto/hii/config_str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ impl ConfigurationString {
183183
/// An `Option<String>` containing the parsed string.
184184
#[must_use]
185185
pub fn parse_string_from_hex(data: &str) -> Option<String> {
186-
if data.len() % 2 != 0 {
186+
if !data.len().is_multiple_of(2) {
187187
return None;
188188
}
189189
let size_bytes = data.len() / 2 + 2; // includes \0 terminator

uefi/src/proto/loaded_image.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ impl LoadedImage {
7575

7676
if self.0.load_options.is_null() {
7777
Err(LoadOptionsError::NotSet)
78-
} else if (load_options_size % size_of::<u16>() != 0)
79-
|| (((self.0.load_options as usize) % align_of::<u16>()) != 0)
78+
} else if !load_options_size.is_multiple_of(size_of::<u16>())
79+
|| !(self.0.load_options as usize).is_multiple_of(align_of::<u16>())
8080
{
8181
Err(LoadOptionsError::NotAligned)
8282
} else {

uefi/src/runtime.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,11 @@ impl Iterator for VariableKeys {
291291

292292
// If the name buffer was too small, resize it to be big enough and call
293293
// `get_next_variable_key` again.
294-
if let Err(err) = &result {
295-
if let Some(required_size) = err.data() {
296-
self.name.resize(*required_size, 0u16);
297-
result = get_next_variable_key(&mut self.name, &mut self.vendor);
298-
}
294+
if let Err(err) = &result
295+
&& let Some(required_size) = err.data()
296+
{
297+
self.name.resize(*required_size, 0u16);
298+
result = get_next_variable_key(&mut self.name, &mut self.vendor);
299299
}
300300

301301
match result {

0 commit comments

Comments
 (0)