awiouy 7 жил өмнө
parent
commit
6a9084b00c
1 өөрчлөгдсөн 3 нэмэгдсэн , 3 устгасан
  1. 3 3
      core/src/component.rs

+ 3 - 3
core/src/component.rs

@@ -39,17 +39,17 @@ macro_rules! component {
 use std::cell::UnsafeCell;
 use std::sync::Mutex;
 
-pub struct Lazy<T>(Mutex<bool>, UnsafeCell<Option<T>>);
+pub(crate) struct Lazy<T>(Mutex<bool>, UnsafeCell<Option<T>>);
 unsafe impl<T: Sync> Sync for Lazy<T> {}
 unsafe impl<T: Send> Send for Lazy<T> {}
 
 #[cfg_attr(feature = "cargo-clippy", allow(mutex_atomic))]
 impl<T> Lazy<T> {
-    pub fn new() -> Lazy<T> {
+    pub(crate) fn new() -> Lazy<T> {
         Lazy(Mutex::new(false), UnsafeCell::new(None))
     }
 
-    pub fn get<F: FnOnce() -> T>(&self, f: F) -> &T {
+    pub(crate) fn get<F: FnOnce() -> T>(&self, f: F) -> &T {
         let mut inner = self.0.lock().unwrap();
         if !*inner {
             unsafe {