Skip to content

Commit 3cbf209

Browse files
committed
rustfmt: fixes for device_path_gen for 2024 edition
1 parent fc8317b commit 3cbf209

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

rustfmt.toml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# We keep this file explicitley to ensure that direct invocations of `rustfmt`
2+
# also use the proper style edition. Unlike `cargo fmt`, which forwards the
3+
# Rust edition specified in Cargo.toml to `rustfmt`, `rustfmt` still defaults to
4+
# the 2021 edition and is unaware of `Cargo.toml`.
5+
#
6+
# We use a direct invocation of `rustfmt` in our device path generation code.
7+
8+
style_edition = "2024"

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/src/proto/device_path/device_path_gen.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use crate::proto::device_path::{
1515
self, DevicePathHeader, DevicePathNode, DeviceSubType, DeviceType, NodeConversionError,
1616
};
1717
use crate::proto::network::IpAddress;
18-
use crate::{guid, Guid};
18+
use crate::{Guid, guid};
1919
use bitflags::bitflags;
2020
use core::mem::{size_of, size_of_val};
2121
use core::ptr::addr_of;
@@ -3647,10 +3647,10 @@ impl TryFrom<&DevicePathNode> for DevicePathNodeEnum<'_> {
36473647
/// Build device paths from their component nodes.
36483648
pub mod build {
36493649
use super::*;
3650+
use crate::CStr16;
36503651
use crate::proto::device_path::build::{BuildError, BuildNode};
36513652
use crate::proto::device_path::{DeviceSubType, DeviceType};
3652-
use crate::CStr16;
3653-
use core::mem::{size_of_val, MaybeUninit};
3653+
use core::mem::{MaybeUninit, size_of_val};
36543654
/// Device path build nodes for [`DeviceType::END`].
36553655
pub mod end {
36563656
use super::*;

xtask/src/device_path/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ fn gen_uefi_code_as_string(groups: &[NodeGroup]) -> Result<String> {
7373
let code = quote!(
7474
use bitflags::bitflags;
7575
use crate::data_types::UnalignedSlice;
76-
use crate::{guid, Guid};
76+
use crate::{Guid, guid};
7777
use crate::polyfill::maybe_uninit_slice_as_mut_ptr;
7878
use crate::proto::device_path::{
7979
self, DevicePathHeader, DevicePathNode, DeviceSubType, DeviceType,

0 commit comments

Comments
 (0)