Why is it allowed to pass the parameter value by reference with the duplicated sign &
?
fn by_ref(v: &u64) -> u64 {
v + 1
}
fn main() {
println!("{}", by_ref(&&&1));
}
Why is it allowed to pass the parameter value by reference with the duplicated sign &
?
fn by_ref(v: &u64) -> u64 {
v + 1
}
fn main() {
println!("{}", by_ref(&&&1));
}