mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-10 12:49:18 +00:00
as ref
This commit is contained in:
parent
0f7fbc10e6
commit
0cdc1122e6
@ -23,9 +23,9 @@ fn char_counter<T>(arg: T) -> usize {
|
|||||||
|
|
||||||
// Squares a number using as_mut().
|
// Squares a number using as_mut().
|
||||||
// TODO: Add the appropriate trait bound.
|
// TODO: Add the appropriate trait bound.
|
||||||
fn num_sq<T>(arg: &mut T) {
|
fn num_sq<T : std::ops::Add<Output = T>>(arg: &mut T) {
|
||||||
// TODO: Implement the function body.
|
// TODO: Implement the function body.
|
||||||
???
|
arg = arg * arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user