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`.
This commit is contained in:
Arkid 2022-09-09 02:40:22 +02:00 committed by GitHub
parent c923e7af73
commit 34ed235885
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -54,7 +54,7 @@ mod tests {
#[test]
fn mult_box() {
let mut num: Box<u32> = Box::new(3);
num_sq(&mut num);
num_sq(&mut *num);
assert_eq!(*num, 9);
}
}