Skip to content

Commit 34ed235

Browse files
authored
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`.
1 parent c923e7a commit 34ed235

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

exercises/conversions/as_ref_mut.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ mod tests {
5454
#[test]
5555
fn mult_box() {
5656
let mut num: Box<u32> = Box::new(3);
57-
num_sq(&mut num);
57+
num_sq(&mut *num);
5858
assert_eq!(*num, 9);
5959
}
6060
}

0 commit comments

Comments
 (0)