rustfmt: fixes for device_path_gen for 2024 edition

This commit is contained in:
Philipp Schuster
2025-03-23 15:53:53 +01:00
parent 83412b60a0
commit b8e1df0f5d
4 changed files with 13 additions and 5 deletions
+8
View File
@@ -0,0 +1,8 @@
# We keep this file explicitley to ensure that direct invocations of `rustfmt`
# also use the proper style edition. Unlike `cargo fmt`, which forwards the
# Rust edition specified in Cargo.toml to `rustfmt`, `rustfmt` still defaults to
# the 2021 edition and is unaware of `Cargo.toml`.
#
# We use a direct invocation of `rustfmt` in our device path generation code.
style_edition = "2024"
@@ -10,7 +10,7 @@
#![allow(missing_debug_implementations)]
use crate::protocol::device_path;
use crate::table::boot::MemoryType;
use crate::{guid, Guid, IpAddress};
use crate::{Guid, IpAddress, guid};
use bitflags::bitflags;
use device_path::DevicePathProtocol as DevicePathHeader;
#[cfg(doc)]
@@ -15,7 +15,7 @@ use crate::proto::device_path::{
self, DevicePathHeader, DevicePathNode, DeviceSubType, DeviceType, NodeConversionError,
};
use crate::proto::network::IpAddress;
use crate::{guid, Guid};
use crate::{Guid, guid};
use bitflags::bitflags;
use core::mem::{size_of, size_of_val};
use core::ptr::addr_of;
@@ -3647,10 +3647,10 @@ impl TryFrom<&DevicePathNode> for DevicePathNodeEnum<'_> {
/// Build device paths from their component nodes.
pub mod build {
use super::*;
use crate::CStr16;
use crate::proto::device_path::build::{BuildError, BuildNode};
use crate::proto::device_path::{DeviceSubType, DeviceType};
use crate::CStr16;
use core::mem::{size_of_val, MaybeUninit};
use core::mem::{MaybeUninit, size_of_val};
/// Device path build nodes for [`DeviceType::END`].
pub mod end {
use super::*;
+1 -1
View File
@@ -73,7 +73,7 @@ fn gen_uefi_code_as_string(groups: &[NodeGroup]) -> Result<String> {
let code = quote!(
use bitflags::bitflags;
use crate::data_types::UnalignedSlice;
use crate::{guid, Guid};
use crate::{Guid, guid};
use crate::polyfill::maybe_uninit_slice_as_mut_ptr;
use crate::proto::device_path::{
self, DevicePathHeader, DevicePathNode, DeviceSubType, DeviceType,