mirror of
https://github.com/freemkv/libfreemkv.git
synced 2026-10-07 18:13:10 +00:00
style: no new #[allow] for the Windows enumeration helpers
Name STORAGE_DEVICE_NUMBER's fields in snake_case (repr(C) layout is unchanged) and compile the 36-byte INQUIRY retry only on Windows, which keeps lint_stop's #[allow] baseline.
This commit is contained in:
+1
-1
@@ -548,7 +548,7 @@ pub fn inquiry(scsi: &mut dyn ScsiTransport) -> Result<InquiryResult> {
|
||||
}
|
||||
|
||||
/// INQUIRY with the standard 36-byte allocation, for bridges that reject longer ones.
|
||||
#[cfg_attr(not(windows), allow(dead_code))]
|
||||
#[cfg(windows)]
|
||||
pub(crate) fn inquiry_standard(scsi: &mut dyn ScsiTransport) -> Result<InquiryResult> {
|
||||
inquiry_alloc(scsi, INQUIRY_MIN_LEN)
|
||||
}
|
||||
|
||||
+5
-6
@@ -108,13 +108,12 @@ struct StorageAdapterDescriptor {
|
||||
BusMinorVersion: u16,
|
||||
}
|
||||
|
||||
/// `STORAGE_DEVICE_NUMBER` (winioctl.h).
|
||||
/// `STORAGE_DEVICE_NUMBER` (winioctl.h): DeviceType, DeviceNumber, PartitionNumber.
|
||||
#[repr(C)]
|
||||
#[allow(non_snake_case)]
|
||||
struct StorageDeviceNumber {
|
||||
DeviceType: u32,
|
||||
DeviceNumber: u32,
|
||||
PartitionNumber: u32,
|
||||
device_type: u32,
|
||||
device_number: u32,
|
||||
_partition_number: u32,
|
||||
}
|
||||
|
||||
// ── Windows FFI ────────────────────────────────────────────────────────────
|
||||
@@ -368,7 +367,7 @@ fn device_number(path: &str) -> Option<u32> {
|
||||
)
|
||||
};
|
||||
unsafe { CloseHandle(handle) };
|
||||
(ok != 0 && number.DeviceType == FILE_DEVICE_CD_ROM).then_some(number.DeviceNumber)
|
||||
(ok != 0 && number.device_type == FILE_DEVICE_CD_ROM).then_some(number.device_number)
|
||||
}
|
||||
|
||||
/// TEST UNIT READY probe on Windows. No in-library recovery: the answer is
|
||||
|
||||
Reference in New Issue
Block a user