File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 100100//! use std::sync::Arc;
101101//!
102102//! use arc_swap::ArcSwap;
103- //! use crossbeam_utils::thread;
104103//!
105104//! let config = ArcSwap::from(Arc::new(String::default()));
106- //! thread::scope(|scope| {
107- //! scope.spawn(|_ | {
105+ //! std:: thread::scope(|scope| {
106+ //! scope.spawn(|| {
108107//! let new_conf = Arc::new("New configuration".to_owned());
109108//! config.store(new_conf);
110109//! });
111110//! for _ in 0..10 {
112- //! scope.spawn(|_ | {
111+ //! scope.spawn(|| {
113112//! loop {
114113//! let cfg = config.load();
115114//! if !cfg.is_empty() {
119118//! }
120119//! });
121120//! }
122- //! }).unwrap() ;
121+ //! });
123122//! ```
124123//!
125124//! [RwLock]: https://doc.rust-lang.org/std/sync/struct.RwLock.html
You can’t perform that action at this time.
0 commit comments