Skip to content

Commit b6696df

Browse files
committed
Fixing clippy
1 parent 2760333 commit b6696df

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/lib.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,31 @@ const GET_STATUS_BYTE: u8 = 0x20;
1212
const SET_STATUS_BYTE: u8 = 0x60;
1313

1414
bitflags! {
15+
/// Represents the flags currently set for the mouse.
1516
#[derive(Default)]
1617
pub struct MouseFlags: u8 {
18+
/// Whether or not the left mouse button is pressed.
1719
const LEFT_BUTTON = 0b0000_0001;
20+
21+
/// Whether or not the right mouse button is pressed.
1822
const RIGHT_BUTTON = 0b0000_0010;
23+
24+
/// Whether or not the middle mouse button is pressed.
1925
const MIDDLE_BUTTON = 0b0000_0100;
26+
27+
/// Whether or not the packet is valid or not.
2028
const ALWAYS_ONE = 0b0000_1000;
29+
30+
/// Whether or not the x delta is negative.
2131
const X_SIGN = 0b0001_0000;
32+
33+
/// Whether or not the y delta is negative.
2234
const Y_SIGN = 0b0010_0000;
35+
36+
/// Whether or not the x delta overflowed.
2337
const X_OVERFLOW = 0b0100_0000;
38+
39+
/// Whether or not the y delta overflowed.
2440
const Y_OVERFLOW = 0b1000_0000;
2541
}
2642
}
@@ -42,6 +58,12 @@ pub struct Mouse {
4258
on_complete: Option<fn(MouseState)>,
4359
}
4460

61+
impl Default for Mouse {
62+
fn default() -> Mouse {
63+
Mouse::new()
64+
}
65+
}
66+
4567
/// A snapshot of the mouse flags, x delta and y delta.
4668
#[derive(Debug, Copy, Clone, Default)]
4769
pub struct MouseState {

0 commit comments

Comments
 (0)