From 34ed2358855e187990636621fdd6e435308532e3 Mon Sep 17 00:00:00 2001 From: Arkid <39987510+aaarkid@users.noreply.github.com> Date: Fri, 9 Sep 2022 02:40:22 +0200 Subject: [PATCH] fix: Add a deref in the test code It's virtually impossible to write a the `num_sq` function to take the Box since it doesn't implement `MulAssign`. --- exercises/conversions/as_ref_mut.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/conversions/as_ref_mut.rs b/exercises/conversions/as_ref_mut.rs index 9f47973..dafbdb9 100644 --- a/exercises/conversions/as_ref_mut.rs +++ b/exercises/conversions/as_ref_mut.rs @@ -54,7 +54,7 @@ mod tests { #[test] fn mult_box() { let mut num: Box = Box::new(3); - num_sq(&mut num); + num_sq(&mut *num); assert_eq!(*num, 9); } }