Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Other: Multiple referene to a struct

#[derive(Debug)]
#[allow(dead_code)]
struct Something {
    number: i32,
    text: String,
    numbers: Vec<i32>,
}

fn main() {
    let a = Something {
        number: 2,
        text: String::from("blue"),
        numbers: vec![5, 6],
    };
    println!("{:?}", &a);

    let b = &a;
    println!("{:?}", &b);
    println!("{:?}", &a);
}