From 6a9084b00c83268e6389a2359e10f1dbc05c620e Mon Sep 17 00:00:00 2001 From: awiouy Date: Mon, 12 Feb 2018 20:20:43 +0100 Subject: [PATCH] core API: Lazy --- core/src/component.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/component.rs b/core/src/component.rs index 923e72ec..29aef1bf 100644 --- a/core/src/component.rs +++ b/core/src/component.rs @@ -39,17 +39,17 @@ macro_rules! component { use std::cell::UnsafeCell; use std::sync::Mutex; -pub struct Lazy(Mutex, UnsafeCell>); +pub(crate) struct Lazy(Mutex, UnsafeCell>); unsafe impl Sync for Lazy {} unsafe impl Send for Lazy {} #[cfg_attr(feature = "cargo-clippy", allow(mutex_atomic))] impl Lazy { - pub fn new() -> Lazy { + pub(crate) fn new() -> Lazy { Lazy(Mutex::new(false), UnsafeCell::new(None)) } - pub fn get T>(&self, f: F) -> &T { + pub(crate) fn get T>(&self, f: F) -> &T { let mut inner = self.0.lock().unwrap(); if !*inner { unsafe {