Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::cell::RefCell;
- thread_local!(static DIR: RefCell<String> = RefCell::new(String::new()));
- fn main() {
- DIR.with(|f| {
- f.borrow_mut().push_str("foobar");
- });
- DIR.with(|f| {
- println!("{}", *f.borrow());
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement