Skip to content

Commit

Permalink
Update mod.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
dstric-aqueduct committed Dec 1, 2022
1 parent 8026f2a commit 4ab5ee0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions imxrt1060-hal/src/can/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use crate::iomuxc::consts::{Unsigned, U1, U2};
use crate::ral;

use core::convert::Infallible;
use core::f32::consts::E;
use core::marker::PhantomData;

/// Error that indicates that an incoming message has been lost due to buffer overrun.
Expand Down Expand Up @@ -196,7 +195,7 @@ fn from_flexcan_mb_cs_code(code: u32) -> u8 {
}

#[inline]
fn constrain(value: usize, min: usize, max: usize) -> usize {
fn constrain<T: PartialOrd>(value: T, min: T, max: T) -> T {
match value {
v if v < min => min,
v if v > max => max,
Expand Down

0 comments on commit 4ab5ee0

Please sign in to comment.