Skip to content

Commit 3f9862b

Browse files
committed
Add tokio as a public crate for easier library importing
- Fix clippy warnings
1 parent 99fce7f commit 3f9862b

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

hid-io-protocol/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ pub fn packet_id(packet_data: &[u8]) -> Result<u32, HidIoParseError> {
328328
// Iterate over bytes, constructing Id of either 16 or 32 bit width
329329
let mut id: u32 = 0;
330330
let offset = 2;
331-
for idx in 0..id_width as usize {
331+
for idx in 0..id_width {
332332
id |= u32::from(packet_data[offset + idx]) << (idx * 8);
333333
}
334334

@@ -386,7 +386,7 @@ pub fn payload_start(packet_data: &[u8]) -> Result<usize, HidIoParseError> {
386386
}
387387

388388
// Determine starting position
389-
Ok(2 + id_width as usize)
389+
Ok(2 + id_width)
390390
}
391391

392392
// ----- Command Utility Functions -----

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ extern crate log;
2323

2424
use std::sync::atomic::Ordering;
2525

26+
pub use tokio;
27+
2628
// ----- Modules -----
2729

2830
/// capnp interface for other programs to hook into

src/module/displayserver/x11.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ impl XConnection {
156156
if elapsed_ms > self.pending_delays {
157157
self.pending_delays = 0; // Safe to send the event immediately
158158
} else {
159-
self.pending_delays -= elapsed_ms as i64 - 1; // Add a 1ms delay
159+
self.pending_delays -= elapsed_ms - 1; // Add a 1ms delay
160160
}
161161
}
162162

0 commit comments

Comments
 (0)