mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-22 14:53:03 +00:00
Merge pull request #1761 from sgoll/fuse-ticker
Mark `Ticker` stream as fused
This commit is contained in:
commit
b7114fb951
@ -3,6 +3,7 @@ use core::pin::Pin;
|
||||
use core::task::{Context, Poll, Waker};
|
||||
|
||||
use futures_util::future::{select, Either};
|
||||
use futures_util::stream::FusedStream;
|
||||
use futures_util::{pin_mut, Stream};
|
||||
|
||||
use crate::{Duration, Instant};
|
||||
@ -163,6 +164,13 @@ impl Stream for Ticker {
|
||||
}
|
||||
}
|
||||
|
||||
impl FusedStream for Ticker {
|
||||
fn is_terminated(&self) -> bool {
|
||||
// `Ticker` keeps yielding values until dropped, it never terminates.
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
extern "Rust" {
|
||||
fn _embassy_time_schedule_wake(at: Instant, waker: &Waker);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user