Skip to content

Commit 82d348e

Browse files
committed
Switch test to TryFrom
1 parent a8f177e commit 82d348e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/naive/internals.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,8 +505,8 @@ const fn weekday_from_u32_mod7(n: u32) -> Weekday {
505505
#[cfg(test)]
506506
mod tests {
507507
use num_iter::range_inclusive;
508-
use num_traits::FromPrimitive;
509508
use std::u32;
509+
use std::convert::TryFrom;
510510

511511
use super::weekday_from_u32_mod7;
512512
use super::{Mdf, Of};
@@ -888,7 +888,7 @@ mod tests {
888888
#[test]
889889
fn test_weekday_from_u32_mod7() {
890890
for i in 0..=1000 {
891-
assert_eq!(weekday_from_u32_mod7(i), Weekday::from_u32(i % 7).unwrap());
891+
assert_eq!(weekday_from_u32_mod7(i), Weekday::try_from((i % 7) as u8).unwrap());
892892
}
893893
assert_eq!(weekday_from_u32_mod7(u32::MAX), Weekday::Thu);
894894
}

0 commit comments

Comments
 (0)