Skip to content

Commit c740f03

Browse files
authored
lazy: Make LazyUsize private. (#482)
It is an implementation detail of the other Lazy* types. It isn't used outside of its own module.
1 parent a8712f3 commit c740f03

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lazy.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,20 @@ use core::{
2424
// }
2525
// the effects of c() or writes to shared memory will not necessarily be
2626
// observed and additional synchronization methods may be needed.
27-
pub(crate) struct LazyUsize(AtomicUsize);
27+
struct LazyUsize(AtomicUsize);
2828

2929
impl LazyUsize {
3030
// The initialization is not completed.
3131
const UNINIT: usize = usize::MAX;
3232

33-
pub const fn new() -> Self {
33+
const fn new() -> Self {
3434
Self(AtomicUsize::new(Self::UNINIT))
3535
}
3636

3737
// Runs the init() function at most once, returning the value of some run of
3838
// init(). Multiple callers can run their init() functions in parallel.
3939
// init() should always return the same value, if it succeeds.
40-
pub fn unsync_init(&self, init: impl FnOnce() -> usize) -> usize {
40+
fn unsync_init(&self, init: impl FnOnce() -> usize) -> usize {
4141
#[cold]
4242
fn do_init(this: &LazyUsize, init: impl FnOnce() -> usize) -> usize {
4343
let val = init();

0 commit comments

Comments
 (0)