Skip to content

Commit d50f66a

Browse files
committed
Add formatting check
1 parent b5be255 commit d50f66a

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

.github/workflows/CI.yml

1.18 KB
Binary file not shown.

src/api.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ impl KeyboardApi {
8080
&& device.product_id() == pid
8181
&& device.usage_page() == usage_page
8282
})
83-
.ok_or(Error::NoSuchKeyboard { vid, pid, usage_page })?
83+
.ok_or(Error::NoSuchKeyboard {
84+
vid,
85+
pid,
86+
usage_page,
87+
})?
8488
.open_device(&api)?;
8589

8690
Ok(KeyboardApi { device })

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ fn qmk_via_api(_py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> {
1717
m.add_class::<scan::KeyboardDeviceInfo>()?;
1818
m.add_function(wrap_pyfunction!(scan::scan_keyboards, m)?)?;
1919
Ok(())
20-
}
20+
}

src/scan.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,13 @@ pub fn scan_keyboards() -> Vec<KeyboardDeviceInfo> {
3333

3434
api.device_list()
3535
.filter(|d| d.usage_page() == VIA_USAGE_PAGE)
36-
.map(|d| {
37-
KeyboardDeviceInfo {
38-
vendor_id: d.vendor_id(),
39-
product_id: d.product_id(),
40-
usage_page: d.usage_page(),
41-
manufacturer: d.manufacturer_string().map(|s| s.to_string()),
42-
product: d.product_string().map(|s| s.to_string()),
43-
serial_number: d.serial_number().map(|s| s.to_string()),
44-
}
36+
.map(|d| KeyboardDeviceInfo {
37+
vendor_id: d.vendor_id(),
38+
product_id: d.product_id(),
39+
usage_page: d.usage_page(),
40+
manufacturer: d.manufacturer_string().map(|s| s.to_string()),
41+
product: d.product_string().map(|s| s.to_string()),
42+
serial_number: d.serial_number().map(|s| s.to_string()),
4543
})
4644
.collect()
4745
}

0 commit comments

Comments
 (0)