From 468de3c0acaf1fafc6ab59622e8a21d13c67e7f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?On=C3=A8?= <43485962+c-git@users.noreply.github.com> Date: Thu, 20 Jun 2024 04:21:14 -0400 Subject: [PATCH] Change test to require impl (#87) impl std::ops::Add<&SaturatingU16> for SaturatingU16 --- exercises/04_traits/14_outro/tests/integration.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exercises/04_traits/14_outro/tests/integration.rs b/exercises/04_traits/14_outro/tests/integration.rs index e991b95..b27b2f8 100644 --- a/exercises/04_traits/14_outro/tests/integration.rs +++ b/exercises/04_traits/14_outro/tests/integration.rs @@ -6,11 +6,12 @@ fn test_saturating_u16() { let b: SaturatingU16 = 5u8.into(); let c: SaturatingU16 = u16::MAX.into(); let d: SaturatingU16 = (&1u16).into(); + let e = &c; assert_eq!(a + b, SaturatingU16::from(15u16)); assert_eq!(a + c, SaturatingU16::from(u16::MAX)); assert_eq!(a + d, SaturatingU16::from(11u16)); assert_eq!(a + a, 20u16); assert_eq!(a + 5u16, 15u16); - assert_eq!(a + &u16::MAX, SaturatingU16::from(u16::MAX)); + assert_eq!(a + e, SaturatingU16::from(u16::MAX)); }