Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static mut my_list: Option<Vec<String>> = None;
- unsafe fn init() {
- my_list = Some(vec![]);
- my_list.as_mut().unwrap().push("item0".to_string());
- my_list.as_mut().unwrap().push("item0".to_string());
- }
- fn main() {
- println!("Hello, world!");
- unsafe {
- init();
- read();
- };
- }
- unsafe fn read() {
- println!("{:?}", my_list);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement