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
  • 388,571
  • 95
  • 1,107
  • 1,366
uetoyo
  • 329
  • 1
  • 3
  • 11

0 Answers0