]> git.lizzy.rs Git - rust.git/commitdiff
Fix outdated rustdoc of Once::init_locking function
authorSantiago Pastorino <spastorino@gmail.com>
Thu, 31 Oct 2019 13:06:14 +0000 (10:06 -0300)
committerSantiago Pastorino <spastorino@gmail.com>
Thu, 31 Oct 2019 13:06:14 +0000 (10:06 -0300)
src/librustc_data_structures/sync.rs

index d111471f53d7d80ad863ca0840423acf914238a2..6a19f52897e5de97d976aaae88e5b954060b81f5 100644 (file)
@@ -492,10 +492,10 @@ pub fn set(&self, value: T) {
         assert!(self.try_set(value).is_none());
     }
 
-    /// Tries to initialize the inner value by calling the closure while ensuring that no-one else
-    /// can access the value in the mean time by holding a lock for the duration of the closure.
-    /// If the value was already initialized the closure is not called and `false` is returned,
-    /// otherwise if the value from the closure initializes the inner value, `true` is returned
+    /// Initializes the inner value if it wasn't already done by calling the provided closure. It
+    /// ensures that no-one else can access the value in the mean time by holding a lock for the
+    /// duration of the closure.
+    /// A reference to the inner value is returned.
     #[inline]
     pub fn init_locking<F: FnOnce() -> T>(&self, f: F) -> &T {
         {