Some(w) => println!("match: second word of '{}' exists: {}", s2, w),
None => println!("match: second word of '{}' does not exist", s2),
}
+
+ let v1 = vec![1, 2, 3];
+ println!("statically initialized vector: {:?}", v1);
+
+ let mut v2: Vec<String> = Vec::new();
+ v2.push("Hello".to_string());
+ v2.push(String::from("world"));
+ println!("dynamically built vector: {:?}", v2);
+ println!("first element: {}", v2[0]);
+ for el in &mut v2 {
+ *el += "xx";
+ }
+ for el in &v2 {
+ println!("{}", el);
+ }
}