Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::cell::RefCell;
- thread_local! {
- static GLOBAL: RefCell<Option<Vec<usize>>> = RefCell::new(Some(vec![1,2,3]));
- }
- fn main() {
- GLOBAL.with(|v| {
- // let mut x = v.borrow_mut();
- // let mut y = x.as_mut().unwrap();
- v.borrow_mut().as_mut().unwrap().push(5);
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement