mirror of
https://github.com/rust-lang/rustlings.git
synced 2024-12-26 00:00:03 +03:00
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:
parent
c923e7af73
commit
34ed235885
|
@ -54,7 +54,7 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn mult_box() {
|
fn mult_box() {
|
||||||
let mut num: Box<u32> = Box::new(3);
|
let mut num: Box<u32> = Box::new(3);
|
||||||
num_sq(&mut num);
|
num_sq(&mut *num);
|
||||||
assert_eq!(*num, 9);
|
assert_eq!(*num, 9);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue