Fix doctest and nitpick

Signed-off-by: John Nunley <dev@notgull.net>
This commit is contained in:
John Nunley 2023-10-18 08:35:13 -07:00
parent ac3978ebb4
commit 5c1124135b
No known key found for this signature in database
GPG Key ID: F27A1BA748ECAED2
1 changed files with 6 additions and 5 deletions

View File

@ -658,10 +658,10 @@ pin_project_lite::pin_project! {
/// another active listener. Whether one *additional* listener will be notified depends on what
/// kind of notification was delivered.
///
/// The listener is not registered into the linked list inside of the [`Event`] by default. It
/// needs to be pinned first before being inserted using the `listen()` method. After the
/// listener has begun `listen`ing, the user can `await` it like a future or call `wait()`
/// to block the current thread until it is notified.
/// The listener is not registered into the linked list inside of the [`Event`] by default if
/// it is created via the `new()` method. It needs to be pinned first before being inserted
/// using the `listen()` method. After the listener has begun `listen`ing, the user can
/// `await` it like a future or call `wait()` to block the current thread until it is notified.
///
/// ## Examples
///
@ -675,10 +675,11 @@ pin_project_lite::pin_project! {
/// let flag = Arc::new(AtomicBool::new(false));
///
/// // Create an event to wait on.
/// let event = Event::new();
/// let event = Arc::new(Event::new());
///
/// thread::spawn({
/// let flag = flag.clone();
/// let event = event.clone();
/// move || {
/// thread::sleep(Duration::from_secs(2));
/// flag.store(true, Ordering::SeqCst);