File tree Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,6 @@ use crate::sync::Once;
47
47
/// You can use `OnceLock` to implement a type that requires "append-only" logic:
48
48
///
49
49
/// ```
50
- /// #![feature(once_cell_try_insert)]
51
50
/// use std::sync::{OnceLock, atomic::{AtomicU32, Ordering}};
52
51
/// use std::thread;
53
52
///
@@ -62,7 +61,7 @@ use crate::sync::Once;
62
61
/// fn push(&self, value: T) {
63
62
/// // FIXME: this impl is concise, but is also slow for long lists or many threads.
64
63
/// // as an exercise, consider how you might improve on it while preserving the behavior
65
- /// if let Err((_, value)) = self.data.try_insert (value) {
64
+ /// if let Err(value) = self.data.set (value) {
66
65
/// let next = self.next.get_or_init(|| Box::new(OnceList::new()));
67
66
/// next.push(value)
68
67
/// };
You can’t perform that action at this time.
0 commit comments