From e00580c8376788c262062feb8d11e82ad5142a33 Mon Sep 17 00:00:00 2001 From: Colin Walker Date: Sun, 7 Jan 2024 18:03:53 +0000 Subject: [PATCH] Fix doc examples --- readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/readme.md b/readme.md index 97e049f..5e1b730 100644 --- a/readme.md +++ b/readme.md @@ -14,9 +14,11 @@ It's common to wrap [`AtomicArc`] in an [`Arc`] itself to allow sharing across threads. ``` +# use std::sync::Arc; # use std::thread; # use atomic_arc::AtomicArc; let arc = Arc::new(AtomicArc::new(Arc::new(1))); +let handle = arc.clone(); thread::spawn(move || { let val = *handle.load(); println!("{val}"); // may print '1' or '2'