Coggle requires JavaScript to display documents.
Vector
let v: Vec<i32> = Vec::new();
let v = vec![1, 2, 3];
let mut v = Vec::new(); v.push(3); v.push(4);
push
[]
let three = &v[2];
get
let three = v.get(3);
None
let v = vec![23, 45, 6]; for i in &v { println!("{}", i); }
let mut v = vec![12, 23, 34]; for i in mut &v { *i += 50; }
enum SpreadSheetCell { Int(i32), Float(f64), Text(String), } let v = vec![ SpreadSheetCell::Int(23), SpreadSheetCell::Text(String::from("blue");), SpreadSheetCell::Float(10.3), ];