Skip to content

Commit e29a30e

Browse files
jonathanpallantthejpster
authored andcommittedSep 13, 2024
Silence some clippy warnings.
Makes `enum Error`officially non-exhaustive.
1 parent 57182d6 commit e29a30e

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed
 

‎src/lib.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,12 @@ where
6868

6969
/// Indicates different error conditions.
7070
#[derive(Debug, PartialEq, Eq, Copy, Clone)]
71+
#[non_exhaustive]
7172
pub enum Error {
7273
BadStartBit,
7374
BadStopBit,
7475
ParityError,
7576
UnknownKeyCode,
76-
#[doc(hidden)]
77-
InvalidState,
7877
}
7978

8079
/// Keycodes that can be generated by a keyboard.
@@ -646,6 +645,12 @@ impl Ps2Decoder {
646645
}
647646
}
648647

648+
impl Default for Ps2Decoder {
649+
fn default() -> Self {
650+
Ps2Decoder::new()
651+
}
652+
}
653+
649654
impl<L> EventDecoder<L>
650655
where
651656
L: KeyboardLayout,

‎src/scancodes/set1.rs

+6
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,12 @@ impl ScancodeSet for ScancodeSet1 {
313313
}
314314
}
315315

316+
impl Default for ScancodeSet1 {
317+
fn default() -> Self {
318+
ScancodeSet1::new()
319+
}
320+
}
321+
316322
#[cfg(test)]
317323
mod test {
318324
use super::*;

‎src/scancodes/set2.rs

+6
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,12 @@ impl ScancodeSet for ScancodeSet2 {
266266
}
267267
}
268268

269+
impl Default for ScancodeSet2 {
270+
fn default() -> Self {
271+
ScancodeSet2::new()
272+
}
273+
}
274+
269275
#[cfg(test)]
270276
mod test {
271277
use super::*;

0 commit comments

Comments
 (0)