Values & References5 / 18
Up next

Dereference with *

fn main() {
    let n: i32 = 10;
    let r = &n;
    // * reads through the reference
    println!("{}", *r + 1);
    // method calls auto-deref, so this also works
    println!("{}", r.pow(2));
}
What you're solving

* reads the value behind a reference