2

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));
}
Shepmaster
  • 326,504
  • 69
  • 892
  • 1,159
uetoyo
  • 229
  • 1
  • 3
  • 10

0 Answers0