Skip to content

Commit

Permalink
Silence some clippy warnings.
Browse files Browse the repository at this point in the history
Makes `enum Error`officially non-exhaustive.
  • Loading branch information
jonathanpallant committed Sep 13, 2024
1 parent 4a48088 commit cddf519
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,12 @@ where

/// Indicates different error conditions.
#[derive(Debug, PartialEq, Eq, Copy, Clone)]
#[non_exhaustive]
pub enum Error {
BadStartBit,
BadStopBit,
ParityError,
UnknownKeyCode,
#[doc(hidden)]
InvalidState,
}

/// Keycodes that can be generated by a keyboard.
Expand Down Expand Up @@ -646,6 +645,12 @@ impl Ps2Decoder {
}
}

impl Default for Ps2Decoder {
fn default() -> Self {
Ps2Decoder::new()
}
}

impl<L> EventDecoder<L>
where
L: KeyboardLayout,
Expand Down
6 changes: 6 additions & 0 deletions src/scancodes/set1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,12 @@ impl ScancodeSet for ScancodeSet1 {
}
}

impl Default for ScancodeSet1 {
fn default() -> Self {
ScancodeSet1::new()
}
}

#[cfg(test)]
mod test {
use super::*;
Expand Down
6 changes: 6 additions & 0 deletions src/scancodes/set2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,12 @@ impl ScancodeSet for ScancodeSet2 {
}
}

impl Default for ScancodeSet2 {
fn default() -> Self {
ScancodeSet2::new()
}
}

#[cfg(test)]
mod test {
use super::*;
Expand Down

0 comments on commit cddf519

Please sign in to comment.