Skip to content

Commit de907c7

Browse files
committed
fix: unnecessary trailing commas and nightly import ordering
- Remove unnecessary trailing commas in format!/println! macros to pass new nightly clippy::unnecessary_trailing_comma lint - Reorder underscore-prefixed imports to match nightly rustfmt sorting
1 parent 0e5d77c commit de907c7

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

general/echo/kmdf/driver/DriverSync/src/device.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
use wdk::{nt_success, paged_code, println};
55
use wdk_sys::{
66
call_unsafe_wdf_function_binding,
7+
_WDF_EXECUTION_LEVEL,
8+
_WDF_SYNCHRONIZATION_SCOPE,
79
NTSTATUS,
810
STATUS_SUCCESS,
911
WDFDEVICE,
@@ -13,8 +15,6 @@ use wdk_sys::{
1315
WDF_NO_HANDLE,
1416
WDF_OBJECT_ATTRIBUTES,
1517
WDF_PNPPOWER_EVENT_CALLBACKS,
16-
_WDF_EXECUTION_LEVEL,
17-
_WDF_SYNCHRONIZATION_SCOPE,
1818
};
1919

2020
use crate::{

general/echo/kmdf/driver/DriverSync/src/queue.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ use wdk::{nt_success, paged_code, println, wdf};
77
use wdk_sys::{
88
call_unsafe_wdf_function_binding,
99
ntddk::{ExAllocatePool2, ExFreePool},
10+
_WDF_EXECUTION_LEVEL,
11+
_WDF_IO_QUEUE_DISPATCH_TYPE,
12+
_WDF_SYNCHRONIZATION_SCOPE,
13+
_WDF_TRI_STATE,
1014
NTSTATUS,
1115
POOL_FLAG_NON_PAGED,
1216
SIZE_T,
@@ -25,10 +29,6 @@ use wdk_sys::{
2529
WDF_NO_HANDLE,
2630
WDF_OBJECT_ATTRIBUTES,
2731
WDF_TIMER_CONFIG,
28-
_WDF_EXECUTION_LEVEL,
29-
_WDF_IO_QUEUE_DISPATCH_TYPE,
30-
_WDF_SYNCHRONIZATION_SCOPE,
31-
_WDF_TRI_STATE,
3232
};
3333

3434
use crate::{

general/echo/kmdf/exe/src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ fn async_io_work(io_type: u32) -> Result<(), Box<dyn Error>> {
413413
// - Memory safety: Returns u32 value (no pointer dereferences)
414414
let error = unsafe { GetLastError() };
415415
if error != ERROR_IO_PENDING {
416-
return Err(format!("{i}th Read failed {error}",).into());
416+
return Err(format!("{i}th Read failed {error}").into());
417417
}
418418
}
419419
} else {
@@ -488,7 +488,7 @@ fn async_io_work(io_type: u32) -> Result<(), Box<dyn Error>> {
488488
}
489489

490490
if io_type == READER_TYPE {
491-
println!("Number of bytes read by request number {i} is {number_of_bytes_transferred}",);
491+
println!("Number of bytes read by request number {i} is {number_of_bytes_transferred}");
492492

493493
if globals.limited_loops {
494494
remaining_requests_to_receive -= 1;
@@ -539,7 +539,7 @@ fn async_io_work(io_type: u32) -> Result<(), Box<dyn Error>> {
539539
}
540540
} else {
541541
println!(
542-
"Number of bytes written by request number {i} is {number_of_bytes_transferred}",
542+
"Number of bytes written by request number {i} is {number_of_bytes_transferred}"
543543
);
544544

545545
if globals.limited_loops {
@@ -636,7 +636,7 @@ fn get_device_path(interface_guid: &Uuid) -> Result<(), Box<dyn Error>> {
636636

637637
if config_ret != DeviceAndDriverInstallation::CR_SUCCESS {
638638
return Err(
639-
format!("Error 0x{config_ret:08X} retrieving device interface list size.",).into(),
639+
format!("Error 0x{config_ret:08X} retrieving device interface list size.").into(),
640640
);
641641
}
642642

tools/dv/kmdf/fail_driver_pool_leak/src/driver.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ use wdk::{nt_success, paged_code, println};
55
use wdk_sys::{
66
call_unsafe_wdf_function_binding,
77
ntddk::ExAllocatePool2,
8+
_WDF_EXECUTION_LEVEL,
9+
_WDF_SYNCHRONIZATION_SCOPE,
810
DRIVER_OBJECT,
911
NTSTATUS,
1012
PCUNICODE_STRING,
@@ -19,8 +21,6 @@ use wdk_sys::{
1921
WDF_NO_HANDLE,
2022
WDF_NO_OBJECT_ATTRIBUTES,
2123
WDF_OBJECT_ATTRIBUTES,
22-
_WDF_EXECUTION_LEVEL,
23-
_WDF_SYNCHRONIZATION_SCOPE,
2424
};
2525

2626
use crate::{GLOBAL_BUFFER, GUID_DEVINTERFACE};

0 commit comments

Comments
 (0)