Skip to content

Commit

Permalink
Add FromBytes
Browse files Browse the repository at this point in the history
  • Loading branch information
kaidokert committed Sep 28, 2024
1 parent 7af2a57 commit 5a02b65
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/fixeduint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1779,7 +1779,7 @@ mod tests {
&[0x12, 0x34, 0x56, 0x78],
);
}

fn from_helper<T>(input: &[u8], expected: T)
where
T: num_traits::FromBytes + core::fmt::Debug + core::cmp::PartialEq,
Expand All @@ -1794,6 +1794,7 @@ mod tests {
assert_eq!(result, expected);
}

#[cfg(feature = "use-unsafe")]
#[test]
fn test_from_bytes() {
from_helper(&[0xAB_u8], 0xAB_u8);
Expand Down

0 comments on commit 5a02b65

Please sign in to comment.