Skip to content

Commit 4287d0a

Browse files
committed
Comment on use of once_cell::Lazy
1 parent 42017e4 commit 4287d0a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/ark/src/test/dummy_frontend.rs

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ use crate::interface::SessionMode;
1212

1313
// There can be only one frontend per process. Needs to be in a mutex because
1414
// the frontend wraps zmq sockets which are unsafe to send across threads.
15+
//
16+
// This is using `Lazy` from the `once_cell` crate instead of other standard
17+
// types because the former provides a way of checking whether it has been
18+
// initialized already.
1519
static FRONTEND: Lazy<Arc<Mutex<DummyFrontend>>> =
1620
Lazy::new(|| Arc::new(Mutex::new(DummyArkFrontend::init())));
1721

0 commit comments

Comments
 (0)