Skip to content

Commit

Permalink
Update src/uart.rs
Browse files Browse the repository at this point in the history
Co-authored-by: chrysn <chrysn@fsfe.org>
  • Loading branch information
kbarning and chrysn authored Dec 7, 2024
1 parent 7d658b7 commit 12e00f2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/uart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ pub enum UartDeviceError {
impl UartDeviceError {
/// Converts the given `c_int` into the matching Enum representation
fn from_c(n: NumericError) -> Self {
const _ENODEV: isize = -(ENODEV as isize);
const _ENOTSUP: isize = -(ENOTSUP as isize);
match n.number {
_ENODEV => Self::InvalidDevice,
_ENOTSUP => Self::UnsupportedConfig,
match n {
crate::error::ENODEV => Self::InvalidDevice,
crate::error::ENOTSUP => Self::UnsupportedConfig,
_ => Self::Other,
}
}
Expand Down

0 comments on commit 12e00f2

Please sign in to comment.