We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d30f3c3 + 7e0b8b3 commit 6a18a9dCopy full SHA for 6a18a9d
uefi-raw/src/protocol/device_path.rs
@@ -304,13 +304,12 @@ impl DevicePathUtilitiesProtocol {
304
#[cfg(test)]
305
mod tests {
306
use super::*;
307
- use core::mem;
308
309
/// Test that ensures the struct is packed. Thus, we don't need to
310
/// explicitly specify `packed`.
311
#[test]
312
fn abi() {
313
- assert_eq!(mem::size_of::<DevicePathProtocol>(), 4);
314
- assert_eq!(mem::align_of::<DevicePathProtocol>(), 1);
+ assert_eq!(size_of::<DevicePathProtocol>(), 4);
+ assert_eq!(align_of::<DevicePathProtocol>(), 1);
315
}
316
uefi-raw/src/table/system.rs
@@ -6,7 +6,6 @@ use crate::table::boot::BootServices;
6
use crate::table::configuration::ConfigurationTable;
7
use crate::table::runtime::RuntimeServices;
8
use crate::{Char16, Handle};
9
-use core::mem::size_of;
10
use core::ptr;
11
12
#[derive(Clone, Debug, Eq, PartialEq)]
uefi-test-runner/src/proto/pci/root_bridge.rs
@@ -1,6 +1,5 @@
1
// SPDX-License-Identifier: MIT OR Apache-2.0
2
3
-use core::mem;
4
use uefi::Handle;
5
use uefi::boot::{OpenProtocolAttributes, OpenProtocolParams, ScopedProtocol, image_handle};
use uefi::proto::ProtocolPointer;
@@ -11,7 +10,7 @@ const RED_HAT_PCI_VENDOR_ID: u16 = 0x1AF4;
const MASS_STORAGE_CTRL_CLASS_CODE: u8 = 0x1;
const SATA_CTRL_SUBCLASS_CODE: u8 = 0x6;
13
14
-const REG_SIZE: u8 = mem::size_of::<u32>() as u8;
+const REG_SIZE: u8 = size_of::<u32>() as u8;
15
16
pub fn test() {
17
let pci_handles = uefi::boot::find_handles::<PciRootBridgeIo>().unwrap();
uefi-test-runner/src/proto/usb/io.rs
use uefi::proto::usb::DeviceDescriptor;
use uefi::proto::usb::io::{ControlTransfer, UsbIo};
use uefi::{Status, boot};
@@ -61,14 +60,14 @@ pub fn test() {
61
60
result.expect("failed to acquire string descriptor");
62
63
64
- let mut buffer = [0u8; mem::size_of::<DeviceDescriptor>()];
+ let mut buffer = [0u8; size_of::<DeviceDescriptor>()];
65
66
io.control_transfer(
67
DEVICE_TO_HOST | STANDARD_REQUEST | DEVICE_RECIPIENT,
68
GET_DESCRIPTOR_REQUEST,
69
u16::from(DEVICE_DESCRIPTOR) << 8,
70
0,
71
- ControlTransfer::DataIn(&mut buffer[..mem::size_of::<DeviceDescriptor>()]),
+ ControlTransfer::DataIn(&mut buffer[..size_of::<DeviceDescriptor>()]),
72
73
)
74
.expect("failed control transfer");
uefi/src/mem/memory_map/impl_.rs
@@ -467,7 +467,7 @@ mod tests {
467
468
fn mmap_raw<'a>(memory: &mut [MemoryDescriptor]) -> (&'a mut [u8], MemoryMapMeta) {
469
let desc_size = size_of::<MemoryDescriptor>();
470
- let len = core::mem::size_of_val(memory);
+ let len = size_of_val(memory);
471
let ptr = memory.as_mut_ptr().cast::<u8>();
472
let slice = unsafe { core::slice::from_raw_parts_mut(ptr, len) };
473
let meta = MemoryMapMeta {
uefi/src/mem/memory_map/mod.rs
@@ -105,7 +105,6 @@ impl MemoryMapMeta {
105
106
mod tests_mmap_artificial {
107
108
- use core::mem::{size_of, size_of_val};
109
110
fn buffer_to_map(buffer: &mut [MemoryDescriptor]) -> MemoryMapRefMut<'_> {
111
let mmap_len = size_of_val(buffer);
uefi/src/mem/util.rs
@@ -120,7 +120,6 @@ mod tests {
120
use crate::{ResultExt, StatusExt};
121
#[cfg(feature = "unstable")]
122
use alloc::alloc::Global;
123
- use core::mem::{align_of, size_of};
124
125
/// Some simple dummy type to test [`make_boxed`].
126
#[derive(Debug)]
uefi/src/proto/device_path/device_path_gen.rs
@@ -17,7 +17,6 @@ use crate::proto::device_path::{
use crate::proto::network::IpAddress;
18
use crate::{Guid, guid};
19
use bitflags::bitflags;
20
-use core::mem::{size_of, size_of_val};
21
use core::ptr::addr_of;
22
use core::{fmt, slice};
23
use ptr_meta::Pointee;
@@ -3650,7 +3649,7 @@ pub mod build {
3650
3649
use crate::CStr16;
3651
use crate::proto::device_path::build::{BuildError, BuildNode};
3652
use crate::proto::device_path::{DeviceSubType, DeviceType};
3653
- use core::mem::{MaybeUninit, size_of_val};
+ use core::mem::MaybeUninit;
3654
/// Device path build nodes for [`DeviceType::END`].
3655
pub mod end {
3656
uefi/src/proto/device_path/mod.rs
@@ -921,7 +921,6 @@ fn open_utility_protocol() -> Result<ScopedProtocol<DevicePathUtilities>, Device
921
922
923
use alloc::vec::Vec;
924
925
926
/// Create a node to `path` from raw data.
927
fn add_node(path: &mut Vec<u8>, device_type: u8, sub_type: u8, node_data: &[u8]) {
uefi/src/proto/pci/mod.rs
@@ -106,7 +106,7 @@ enum PciIoMode {
fn encode_io_mode_and_unit<U: PciIoUnit>(mode: PciIoMode) -> PciRootBridgeIoProtocolWidth {
- match (mode, core::mem::size_of::<U>()) {
+ match (mode, size_of::<U>()) {
(PciIoMode::Normal, 1) => PciRootBridgeIoProtocolWidth::UINT8,
(PciIoMode::Normal, 2) => PciRootBridgeIoProtocolWidth::UINT16,
112
(PciIoMode::Normal, 4) => PciRootBridgeIoProtocolWidth::UINT32,
@@ -129,11 +129,10 @@ fn encode_io_mode_and_unit<U: PciIoUnit>(mode: PciIoMode) -> PciRootBridgeIoProt
129
130
131
use super::PciIoAddress;
132
133
134
135
fn test_pci_ioaddr_raw_conversion() {
136
- assert_eq!(mem::size_of::<u64>(), mem::size_of::<PciIoAddress>());
+ assert_eq!(size_of::<u64>(), size_of::<PciIoAddress>());
137
let srcaddr = PciIoAddress {
138
reg: 0x11,
139
fun: 0x33,
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments