We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e1bf258 commit d48fecbCopy full SHA for d48fecb
creational/singleton/how-to-create/README.md
@@ -118,5 +118,6 @@ cargo run --bin singleton-mutex
118
### Output
119
120
```
121
-Called 3 times
+Called 3 times: [1, 1, 1]
122
+New singleton object: [3, 4, 5]
123
creational/singleton/how-to-create/mutex.rs
@@ -21,5 +21,11 @@ fn main() {
21
do_a_call();
22
23
24
- println!("Called {} times", ARRAY.lock().unwrap().len());
+ let array = ARRAY.lock().unwrap();
25
+ println!("Called {} times: {:?}", array.len(), array);
26
+ drop(array);
27
+
28
+ *ARRAY.lock().unwrap() = vec![3, 4, 5];
29
30
+ println!("New singleton object: {:?}", ARRAY.lock().unwrap());
31
}
0 commit comments