Skip to content

Commit f7d7ede

Browse files
committed
Fix: Filtering on Windows
1 parent 1faa577 commit f7d7ede

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ license = "MIT"
66
name = "usb_enumeration"
77
readme = "README.md"
88
repository = "https://github.com/meatysolutions/usb_enumeration"
9-
version = "0.1.1"
9+
version = "0.1.2"
1010

1111
[lib]
1212
crate-type = ["lib"]

src/windows.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ pub fn enumerate_platform(vid: Option<u16>, pid: Option<u16>) -> Vec<UsbDevice>
2828

2929
let mut i = 0;
3030
while unsafe { SetupDiEnumDeviceInfo(dev_info, i, &mut dev_info_data) } > 0 {
31+
i += 1;
3132
let mut buf: Vec<u8> = vec![0; 1000];
3233

3334
if unsafe {
@@ -94,8 +95,6 @@ pub fn enumerate_platform(vid: Option<u16>, pid: Option<u16>) -> Vec<UsbDevice>
9495
}
9596
}
9697
}
97-
98-
i += 1;
9998
}
10099

101100
unsafe { SetupDiDestroyDeviceInfoList(dev_info) };

0 commit comments

Comments
 (0)