Skip to content

Commit 195e139

Browse files
committed
rustfmt: update to edition 2024
1 parent f65403c commit 195e139

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+200
-178
lines changed

rustfmt.toml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
style_edition = "2024"

uefi-macros/src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ extern crate proc_macro;
77
use proc_macro::TokenStream;
88

99
use proc_macro2::TokenStream as TokenStream2;
10-
use quote::{quote, quote_spanned, TokenStreamExt};
10+
use quote::{TokenStreamExt, quote, quote_spanned};
1111
use syn::spanned::Spanned;
1212
use syn::{
13-
parse_macro_input, parse_quote, parse_quote_spanned, Error, Expr, ExprLit, ExprPath, ItemFn,
14-
ItemStruct, Lit, Visibility,
13+
Error, Expr, ExprLit, ExprPath, ItemFn, ItemStruct, Lit, Visibility, parse_macro_input,
14+
parse_quote, parse_quote_spanned,
1515
};
1616

1717
macro_rules! err {
@@ -74,7 +74,7 @@ pub fn unsafe_protocol(args: TokenStream, input: TokenStream) -> TokenStream {
7474
expr,
7575
"macro input must be either a string literal or path to a constant"
7676
)
77-
.into()
77+
.into();
7878
}
7979
};
8080

uefi-raw/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub mod time;
3434
mod status;
3535

3636
pub use status::Status;
37-
pub use uguid::{guid, Guid};
37+
pub use uguid::{Guid, guid};
3838

3939
use core::ffi::c_void;
4040
use core::fmt::{self, Debug, Formatter};

uefi-raw/src/protocol/block.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

3-
use crate::{guid, Boolean, Guid, Status};
3+
use crate::{Boolean, Guid, Status, guid};
44
use core::ffi::c_void;
55

66
/// Logical block address.

uefi-raw/src/protocol/console.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
pub mod serial;
44

5-
use crate::{guid, Boolean, Char16, Event, Guid, PhysicalAddress, Status};
5+
use crate::{Boolean, Char16, Event, Guid, PhysicalAddress, Status, guid};
66
use bitflags::bitflags;
77
use core::ptr;
88

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

3-
use crate::{guid, Guid, Status};
3+
use crate::{Guid, Status, guid};
44
use bitflags::bitflags;
55

66
bitflags! {

uefi-raw/src/protocol/device_path.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
mod device_path_gen;
44

5-
use crate::{guid, Boolean, Char16, Guid};
5+
use crate::{Boolean, Char16, Guid, guid};
66

77
pub use device_path_gen::{acpi, bios_boot_spec, end, hardware, media, messaging};
88

uefi-raw/src/protocol/device_path/device_path_gen.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#![allow(missing_debug_implementations)]
1111
use crate::protocol::device_path;
1212
use crate::table::boot::MemoryType;
13-
use crate::{guid, Guid, IpAddress};
13+
use crate::{Guid, IpAddress, guid};
1414
use bitflags::bitflags;
1515
use device_path::DevicePathProtocol as DevicePathHeader;
1616
#[cfg(doc)]

uefi-raw/src/protocol/disk.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

3-
use crate::{guid, Event, Guid, Status};
3+
use crate::{Event, Guid, Status, guid};
44
use core::ffi::c_void;
55

66
#[derive(Debug)]

uefi-raw/src/protocol/driver.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

33
use crate::protocol::device_path::DevicePathProtocol;
4-
use crate::{guid, Guid, Handle, Status};
4+
use crate::{Guid, Handle, Status, guid};
55

66
#[derive(Debug)]
77
#[repr(C)]

uefi-raw/src/protocol/file_system.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

33
use crate::time::Time;
4-
use crate::{guid, Boolean, Char16, Event, Guid, Status};
4+
use crate::{Boolean, Char16, Event, Guid, Status, guid};
55
use bitflags::bitflags;
66
use core::ffi::c_void;
77

uefi-raw/src/protocol/firmware_volume.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use crate::firmware_storage::FirmwareVolumeAttributes;
44
use crate::protocol::block::Lba;
5-
use crate::{guid, Guid, Handle, PhysicalAddress, Status};
5+
use crate::{Guid, Handle, PhysicalAddress, Status, guid};
66
use core::ffi::c_void;
77
use core::ops::RangeInclusive;
88

uefi-raw/src/protocol/hii/database.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! Bindings for HII Database Protocol
44
55
use super::{HiiHandle, HiiPackageHeader, HiiPackageListHeader, KeyDescriptor};
6-
use crate::{guid, Guid, Handle, Status};
6+
use crate::{Guid, Handle, Status, guid};
77

88
/// EFI_HII_KEYBOARD_LAYOUT
99
#[derive(Debug)]

uefi-raw/src/protocol/loaded_image.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use crate::protocol::device_path::DevicePathProtocol;
44
use crate::table::boot::MemoryType;
55
use crate::table::system::SystemTable;
6-
use crate::{guid, Guid, Handle, Status};
6+
use crate::{Guid, Handle, Status, guid};
77
use core::ffi::c_void;
88

99
#[derive(Clone, Copy, Debug)]

uefi-raw/src/protocol/media.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

33
use crate::protocol::device_path::DevicePathProtocol;
4-
use crate::{guid, Boolean, Guid, Status};
4+
use crate::{Boolean, Guid, Status, guid};
55
use core::ffi::c_void;
66

77
#[derive(Debug)]

uefi-raw/src/protocol/memory_protection.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

33
use crate::table::boot::MemoryAttribute;
4-
use crate::{guid, Guid, PhysicalAddress, Status};
4+
use crate::{Guid, PhysicalAddress, Status, guid};
55

66
#[derive(Debug)]
77
#[repr(C)]

uefi-raw/src/protocol/misc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

33
use crate::table::runtime;
4-
use crate::{guid, Guid, Status};
4+
use crate::{Guid, Status, guid};
55

66
#[derive(Debug)]
77
#[repr(C)]

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

3-
use crate::{guid, Boolean, Char8, Event, Guid, Ipv4Address, MacAddress, Status};
3+
use crate::{Boolean, Char8, Event, Guid, Ipv4Address, MacAddress, Status, guid};
44
use core::ffi::c_void;
55

66
newtype_enum! {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

3-
use crate::{guid, Boolean, Char16, Char8, Event, Guid, Ipv4Address, Ipv6Address, Status};
3+
use crate::{Boolean, Char8, Char16, Event, Guid, Ipv4Address, Ipv6Address, Status, guid};
44
use core::ffi::c_void;
55
use core::fmt::{self, Debug, Formatter};
66
use core::ptr;

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

33
use crate::protocol::network::ip4::Ip4RouteTable;
4-
use crate::{guid, Char16, Event, Guid, Ipv4Address, MacAddress, Status};
4+
use crate::{Char16, Event, Guid, Ipv4Address, MacAddress, Status, guid};
55
use core::ffi::c_void;
66

77
newtype_enum! {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

3-
use crate::{guid, Boolean, Char8, Guid, IpAddress, MacAddress, Status};
3+
use crate::{Boolean, Char8, Guid, IpAddress, MacAddress, Status, guid};
44
use bitflags::bitflags;
55
use core::ffi::c_void;
66
use core::fmt::{self, Debug, Formatter};

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

3-
use crate::{guid, Guid, Status};
3+
use crate::{Guid, Status, guid};
44
use core::ffi::c_void;
55

66
newtype_enum! {

uefi-raw/src/protocol/rng.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
//! `Rng` protocol.
44
5-
use crate::{guid, Guid, Status};
5+
use crate::{Guid, Status, guid};
66

77
newtype_enum! {
88
/// The algorithms listed are optional, not meant to be exhaustive

uefi-raw/src/protocol/scsi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

33
use super::device_path::DevicePathProtocol;
4-
use crate::{guid, Event, Guid, Status};
4+
use crate::{Event, Guid, Status, guid};
55
use core::ffi::c_void;
66

77
pub const SCSI_TARGET_MAX_BYTES: usize = 0x10;

uefi-raw/src/protocol/shell_params.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

3-
use crate::{guid, Char16, Guid};
3+
use crate::{Char16, Guid, guid};
44
use core::ffi::c_void;
55

66
pub type ShellFileHandle = *const c_void;

uefi-raw/src/protocol/string.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

3-
use crate::{guid, Char16, Char8, Guid};
3+
use crate::{Char8, Char16, Guid, guid};
44

55
#[derive(Debug)]
66
#[repr(C)]

uefi-raw/src/protocol/tcg/v1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//! [TCG]: https://trustedcomputinggroup.org/
1111
//! [TPM]: https://en.wikipedia.org/wiki/Trusted_Platform_Module
1212
13-
use crate::{guid, Guid, PhysicalAddress, Status};
13+
use crate::{Guid, PhysicalAddress, Status, guid};
1414
use core::ffi::c_void;
1515

1616
/// Information about the protocol and the TPM device.

uefi-raw/src/protocol/tcg/v2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//! [TPM]: https://en.wikipedia.org/wiki/Trusted_Platform_Module
1414
1515
use super::EventType;
16-
use crate::{guid, Guid, PhysicalAddress, Status};
16+
use crate::{Guid, PhysicalAddress, Status, guid};
1717
use bitflags::bitflags;
1818
use core::ffi::c_void;
1919

uefi-raw/src/table/runtime.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
//! UEFI services available at runtime, even after the OS boots.
44
55
use crate::capsule::CapsuleHeader;
6-
use crate::table::boot::MemoryDescriptor;
76
use crate::table::Header;
7+
use crate::table::boot::MemoryDescriptor;
88
use crate::time::Time;
9-
use crate::{guid, Boolean, Char16, Guid, PhysicalAddress, Status};
9+
use crate::{Boolean, Char16, Guid, PhysicalAddress, Status, guid};
1010
use bitflags::bitflags;
1111
use core::ffi::c_void;
1212

uefi-raw/src/table/system.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

33
use crate::protocol::console::{SimpleTextInputProtocol, SimpleTextOutputProtocol};
4+
use crate::table::Header;
45
use crate::table::boot::BootServices;
56
use crate::table::configuration::ConfigurationTable;
67
use crate::table::runtime::RuntimeServices;
7-
use crate::table::Header;
88
use crate::{Char16, Handle};
99
use core::mem::size_of;
1010
use core::ptr;

uefi-test-runner/src/bin/shell_launcher.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ use alloc::vec::Vec;
1717
use log::info;
1818
use uefi::boot::{self, LoadImageSource};
1919
use uefi::prelude::*;
20+
use uefi::proto::BootPolicy;
2021
use uefi::proto::device_path::build::{self, DevicePathBuilder};
2122
use uefi::proto::device_path::{DevicePath, DeviceSubType, DeviceType, LoadedImageDevicePath};
2223
use uefi::proto::loaded_image::LoadedImage;
23-
use uefi::proto::BootPolicy;
2424

2525
/// Get the device path of the shell app. This is the same as the
2626
/// currently-loaded image's device path, but with the file path part changed.

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use uefi::boot::{
88
};
99
use uefi::mem::memory_map::MemoryType;
1010
use uefi::proto::unsafe_protocol;
11-
use uefi::{boot, guid, system, Event, Guid, Identify};
11+
use uefi::{Event, Guid, Identify, boot, guid, system};
1212

1313
pub fn test() {
1414
test_tpl();

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
use alloc::string::ToString;
44
use uefi::boot::{LoadImageSource, SearchType};
55
use uefi::fs::FileSystem;
6+
use uefi::proto::BootPolicy;
67
use uefi::proto::console::text::Output;
78
use uefi::proto::device_path::media::FilePath;
89
use uefi::proto::device_path::{DevicePath, LoadedImageDevicePath};
9-
use uefi::proto::BootPolicy;
10-
use uefi::{boot, CString16, Identify};
10+
use uefi::{CString16, Identify, boot};
1111

1212
mod memory;
1313
mod misc;

uefi-test-runner/src/fs/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use alloc::vec::Vec;
77
use uefi::boot::ScopedProtocol;
88
use uefi::fs::{FileSystem, IoError, IoErrorContext, PathBuf};
99
use uefi::proto::media::fs::SimpleFileSystem;
10-
use uefi::{cstr16, fs, Status};
10+
use uefi::{Status, cstr16, fs};
1111

1212
/// Tests functionality from the `uefi::fs` module. This test relies on a
1313
/// working File System Protocol, which is tested at a dedicated place.

uefi-test-runner/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use uefi::prelude::*;
1515
use uefi::proto::console::serial::Serial;
1616
use uefi::proto::device_path::build::{self, DevicePathBuilder};
1717
use uefi::proto::device_path::messaging::Vendor;
18-
use uefi::{print, println, system, Result};
18+
use uefi::{Result, print, println, system};
1919

2020
mod boot;
2121
mod fs;

uefi-test-runner/src/proto/console/gop.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

3-
use crate::{send_request_to_host, HostRequest};
3+
use crate::{HostRequest, send_request_to_host};
44
use uefi::boot::{self, OpenProtocolAttributes, OpenProtocolParams};
55
use uefi::proto::console::gop::{BltOp, BltPixel, FrameBuffer, GraphicsOutput, PixelFormat};
66

uefi-test-runner/src/proto/console/serial.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use crate::reconnect_serial_to_console;
44
use uefi::proto::console::serial::{ControlBits, Serial};
5-
use uefi::{boot, Result, ResultExt, Status};
5+
use uefi::{Result, ResultExt, Status, boot};
66

77
// For the duration of this function, the serial device is opened in
88
// exclusive mode. That means logs will not work, which means we should

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ fn test_debug_support() {
8080
// make sure that the max processor index is a sane value, i.e. it works
8181
let maximum_processor_index = debug_support.get_maximum_processor_index();
8282
assert_ne!(
83-
maximum_processor_index,
84-
usize::MAX,
85-
"get_maximum_processor_index() returning garbage, unless you really have 18,446,744,073,709,551,615 processors"
86-
);
83+
maximum_processor_index,
84+
usize::MAX,
85+
"get_maximum_processor_index() returning garbage, unless you really have 18,446,744,073,709,551,615 processors"
86+
);
8787

8888
info!("- Architecture: {:?}", debug_support.arch());
8989
info!("- Maximum Processor Index: {:?}", maximum_processor_index);

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use uefi::proto::device_path::build::{self, DevicePathBuilder};
66
use uefi::proto::device_path::text::{
77
AllowShortcuts, DevicePathFromText, DevicePathToText, DisplayOnly,
88
};
9-
use uefi::proto::device_path::{messaging, DevicePath, DevicePathNode, LoadedImageDevicePath};
9+
use uefi::proto::device_path::{DevicePath, DevicePathNode, LoadedImageDevicePath, messaging};
1010
use uefi::proto::loaded_image::LoadedImage;
1111
use uefi::proto::media::disk::DiskIo;
1212
use uefi::{boot, cstr16};

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

+6-4
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,12 @@ fn test_component_name<C: ComponentNameInterface>(english: &str) {
104104
.find_map(|handle| {
105105
let component_name = C::open(*handle).ok()?;
106106

107-
assert!(component_name
108-
.supported_languages()
109-
.ok()?
110-
.any(|lang| lang == english));
107+
assert!(
108+
component_name
109+
.supported_languages()
110+
.ok()?
111+
.any(|lang| lang == english)
112+
);
111113

112114
let driver_name = component_name.driver_name(english).ok()?;
113115
if driver_name == fat_driver_name {

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ use core::ffi::c_void;
77
use core::pin::Pin;
88
use core::ptr;
99
use core::ptr::addr_of;
10+
use uefi::proto::BootPolicy;
1011
use uefi::proto::device_path::build::DevicePathBuilder;
1112
use uefi::proto::media::load_file::{LoadFile, LoadFile2};
12-
use uefi::proto::BootPolicy;
13-
use uefi::{boot, Guid, Handle};
13+
use uefi::{Guid, Handle, boot};
1414
use uefi_raw::protocol::device_path::DevicePathProtocol;
1515
use uefi_raw::protocol::media::{LoadFile2Protocol, LoadFileProtocol};
1616
use uefi_raw::{Boolean, Status};

0 commit comments

Comments
 (0)