Skip to content

Commit c889cb7

Browse files
authored
Merge pull request #1968 from rust-osdev/allow-expect
treewide: allow() -> expect() + remove unneeded allow()
2 parents 19c2eda + a63f87c commit c889cb7

29 files changed

Lines changed: 42 additions & 51 deletions

File tree

uefi-raw/src/enums.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
/// # use uefi_raw::newtype_enum;
3636
/// newtype_enum! {
3737
/// #[derive(Default)]
38-
/// pub enum UnixBool: i32 => #[allow(missing_docs)] {
38+
/// pub enum UnixBool: i32 => #[expect(missing_docs)] {
3939
/// FALSE = 0,
4040
/// TRUE = 1,
4141
/// /// Nobody expects the Unix inquisition!
@@ -59,7 +59,6 @@ macro_rules! newtype_enum {
5959
$visibility struct $type(pub $base_integer);
6060

6161
$(#[$impl_attrs])*
62-
#[allow(unused)]
6362
impl $type {
6463
$(
6564
$(#[$variant_attrs])*

uefi-raw/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ impl From<bool> for Boolean {
9696
}
9797

9898
impl From<Boolean> for bool {
99-
#[allow(clippy::match_like_matches_macro)]
99+
#[expect(clippy::match_like_matches_macro)]
100100
fn from(value: Boolean) -> Self {
101101
// We handle it as in C: Any bit-pattern != 0 equals true
102102
match value.0 {

uefi-raw/src/protocol/console/serial.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ impl SerialIoProtocol {
117117
/// Serial I/O protocol (revision 1.1).
118118
#[derive(Debug)]
119119
#[repr(C)]
120-
#[allow(non_camel_case_types)]
121120
pub struct SerialIoProtocol_1_1 {
122121
pub base_protocol: SerialIoProtocol,
123122
pub device_type_guid: *const Guid,

uefi-raw/src/protocol/network/tcp4.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ pub struct Tcp4Protocol {
2323
/// this instance into user-supplied structs. This function can
2424
/// also be used to retrieve the operational setting of underlying
2525
/// drivers such as IPv4, MNP, or SNP.
26-
#[allow(clippy::type_complexity)]
2726
pub get_mode_data: unsafe extern "efiapi" fn(
2827
this: *mut Self,
2928
connection_state: *mut Tcp4ConnectionState,

uefi-raw/src/table/revision.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub struct Revision(pub u32);
3838

3939
// Allow missing docs, there's nothing useful to document about these
4040
// constants.
41-
#[allow(missing_docs)]
41+
#[expect(missing_docs)]
4242
impl Revision {
4343
pub const EFI_1_02: Self = Self::new(1, 2);
4444
pub const EFI_1_10: Self = Self::new(1, 10);

uefi-test-runner/src/boot/memory.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ mod global {
107107
}
108108

109109
/// Simple test to ensure our custom allocator works with correct alignment.
110-
#[allow(dead_code)] // Ignore warning due to field not being read.
110+
#[expect(dead_code)] // Ignore warning due to field not being read.
111111
pub fn alloc_alignment() {
112112
{
113113
info!("Allocating a structure with alignment of 0x100 using the global allocator");

uefi-test-runner/src/proto/driver.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use uefi::prelude::*;
55
use uefi::proto::driver::{ComponentName, ComponentName2, LanguageError, LanguageIter};
66
use uefi::{CStr16, Result};
77

8-
#[allow(deprecated)]
8+
#[expect(deprecated)]
99
use uefi::proto::driver::ComponentName1;
1010

1111
/// Generic interface for testing `ComponentName1`, `ComponentName2`, and
@@ -22,7 +22,7 @@ trait ComponentNameInterface: Sized {
2222
) -> Result<&CStr16>;
2323
}
2424

25-
#[allow(deprecated)]
25+
#[expect(deprecated)]
2626
impl ComponentNameInterface for ScopedProtocol<ComponentName1> {
2727
fn open(handle: Handle) -> Result<Self> {
2828
boot::open_protocol_exclusive::<ComponentName1>(handle)
@@ -140,7 +140,7 @@ fn test_component_name<C: ComponentNameInterface>(english: &str) {
140140
pub fn test() {
141141
info!("Running component name test");
142142

143-
#[allow(deprecated)]
143+
#[expect(deprecated)]
144144
test_component_name::<ScopedProtocol<ComponentName1>>("eng");
145145
test_component_name::<ScopedProtocol<ComponentName2>>("en");
146146
test_component_name::<ComponentName>("en");

uefi/src/data_types/strs.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,6 @@ mod tests {
11051105

11061106
// Code generation helper for the compare tests of our CStrX types against "str" and "String"
11071107
// from the standard library.
1108-
#[allow(non_snake_case)]
11091108
macro_rules! test_compare_cstrX {
11101109
($input:ident) => {
11111110
assert!($input.eq_str_until_nul(&"test"));

uefi/src/helpers/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ mod println;
4444
/// # Panics
4545
///
4646
/// This function may panic if called more than once.
47-
#[allow(clippy::missing_const_for_fn)]
4847
pub fn init() -> Result<()> {
4948
// Set up logging.
5049
#[cfg(feature = "logger")]
@@ -55,7 +54,6 @@ pub fn init() -> Result<()> {
5554
Ok(())
5655
}
5756

58-
#[allow(clippy::missing_const_for_fn)]
5957
pub(crate) fn exit() {
6058
#[cfg(feature = "logger")]
6159
logger::disable();

uefi/src/mem/memory_map/impl_.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ impl IndexMut<usize> for MemoryMapRefMut<'_> {
269269
///
270270
/// [`boot::get_memory_map`]: crate::boot::get_memory_map
271271
#[derive(Debug)]
272-
#[allow(clippy::len_without_is_empty)] // this type is never empty
273272
pub(crate) struct MemoryMapBackingMemory(NonNull<[u8]>);
274273

275274
impl MemoryMapBackingMemory {

0 commit comments

Comments
 (0)