You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asyncband.apache.org by ti...@apache.org on 2026/10/03 06:36:59 UTC

(asyncband) 13/22: docs(once-cell): align OnceCell docs with take() and task terminology

This is an automated email from the ASF dual-hosted git repository.

tisonkun pushed a commit to branch tison/deslopify
in repository https://gitbox.apache.org/repos/asf/asyncband.git

commit 48229b90e6a01261e947d206c89146dae36eebb5
Author: tison <wa...@gmail.com>
AuthorDate: Sat Oct 3 14:28:15 2026 +0800

    docs(once-cell): align OnceCell docs with take() and task terminology
    
    The struct summary promised std-style "initialized at most once"
    semantics, but take() deliberately moves the cell back to an
    uninitialized state so it can be initialized again; the module-level
    docs already describe the actual contract. The set() docs also said
    "thread" where every sibling method says "task".
---
 asyncband/src/once/once_cell/mod.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/asyncband/src/once/once_cell/mod.rs b/asyncband/src/once/once_cell/mod.rs
index 39ee75f..f084b6f 100644
--- a/asyncband/src/once/once_cell/mod.rs
+++ b/asyncband/src/once/once_cell/mod.rs
@@ -31,7 +31,7 @@ use crate::internal::value_cell::ValueCell;
 use crate::semaphore::Semaphore;
 use crate::semaphore::SemaphorePermit;
 
-/// A thread-safe cell whose value is asynchronously initialized at most once.
+/// A thread-safe cell that stores one value from an initializer supplied at access time.
 ///
 /// Callers provide an initializer when accessing an empty cell. An initializer that returns an
 /// error, panics, or is cancelled leaves the cell empty so a later caller can retry. Use
@@ -297,7 +297,7 @@ impl<T> OnceCell<T> {
 
     /// Initializes the contents of the cell to `value`.
     ///
-    /// May wait if another thread is currently attempting to initialize the cell. The cell is
+    /// May wait if another task is currently attempting to initialize the cell. The cell is
     /// guaranteed to contain a value when `set` returns, though not necessarily the one provided.
     ///
     /// Returns `Ok(())` if the cell was uninitialized and `Err(value)` if the cell was already


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@asyncband.apache.org
For additional commands, e-mail: commits-help@asyncband.apache.org