diff options
Diffstat (limited to 'embassy-sync/src/once_lock.rs')
| -rw-r--r-- | embassy-sync/src/once_lock.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/embassy-sync/src/once_lock.rs b/embassy-sync/src/once_lock.rs index f83577a6d..31cc99711 100644 --- a/embassy-sync/src/once_lock.rs +++ b/embassy-sync/src/once_lock.rs | |||
| @@ -33,7 +33,7 @@ use core::task::Poll; | |||
| 33 | /// // Wait for the value to be initialized | 33 | /// // Wait for the value to be initialized |
| 34 | /// // and get a static reference it | 34 | /// // and get a static reference it |
| 35 | /// assert_eq!(VALUE.get().await, &20); | 35 | /// assert_eq!(VALUE.get().await, &20); |
| 36 | /// | 36 | /// |
| 37 | /// }; | 37 | /// }; |
| 38 | /// block_on(f) | 38 | /// block_on(f) |
| 39 | /// ``` | 39 | /// ``` |
| @@ -56,7 +56,6 @@ impl<T> OnceLock<T> { | |||
| 56 | /// Get a reference to the underlying value, waiting for it to be set. | 56 | /// Get a reference to the underlying value, waiting for it to be set. |
| 57 | /// If the value is already set, this will return immediately. | 57 | /// If the value is already set, this will return immediately. |
| 58 | pub async fn get(&self) -> &T { | 58 | pub async fn get(&self) -> &T { |
| 59 | |||
| 60 | poll_fn(|cx| match self.try_get() { | 59 | poll_fn(|cx| match self.try_get() { |
| 61 | Some(data) => Poll::Ready(data), | 60 | Some(data) => Poll::Ready(data), |
| 62 | None => { | 61 | None => { |
