mirror of
https://github.com/notohh/rustlings.git
synced 2024-11-26 15:24:17 -05:00
fix: Revert deref change
Revert the addition of a deref in PR #1192 by me, which should not be there. Apologies for the inconvenience caused.
This commit is contained in:
parent
b17295b36f
commit
623161e50d
1 changed files with 2 additions and 2 deletions
|
@ -17,7 +17,7 @@ fn char_counter<T>(arg: T) -> usize {
|
||||||
arg.as_ref().chars().count()
|
arg.as_ref().chars().count()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Squares a number using AsMut. Add the trait bound as is appropriate and
|
// Squares a number using as_mut(). Add the trait bound as is appropriate and
|
||||||
// implement the function body.
|
// implement the function body.
|
||||||
fn num_sq<T>(arg: &mut T) {
|
fn num_sq<T>(arg: &mut T) {
|
||||||
???
|
???
|
||||||
|
@ -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