fix use_future todos!

This commit is contained in:
Jonathan Kelley committed 2024-02-02 14:17:53 -08:00
1 parent f44b72f5e1
commit 8a38a41512
2 files changed
+66 -52

No files matched your search

+3 -3
View File
@@ -24,7 +24,7 @@ where
flush_sync().await;
state.set(UseFutureState::Pending);
fut.await;
state.set(UseFutureState::Complete);
state.set(UseFutureState::Ready);
})
});
@@ -70,7 +70,7 @@ pub enum UseFutureState {
Paused,
/// The future has completed
Complete,
Ready,
}
impl UseFuture {
@@ -118,7 +118,7 @@ impl UseFuture {
pub fn finished(&self) -> bool {
matches!(
self.state.peek().clone(),
UseFutureState::Complete | UseFutureState::Stopped
UseFutureState::Ready | UseFutureState::Stopped
)
}