fn main() { vector1(); } fn vector1() { let mut v = Vec::new(); v.push(5); // Unless you do a push operation on the vec, you must infer the type previously v.push(6); v.push(7); v.push(8); let pop_value = v.pop(); // Take out last item and returns it let third = &v[2]; println!("Accessing value 3 {}", third); let var = v.get(2); if let Some(var2) = var { println!("Value is valid {}", var2); } match v.get(5) { Some(var2) => {println!("Accessible Value {}", var2);}, None => println!("Uh oh"), } }