Merge pull request from Frostie314159/ticker_send_sync

Made `Ticker::next` `Send+Sync`.
This commit is contained in:
Dario Nieuwenhuis 2024-03-31 20:23:30 +00:00 committed by GitHub
commit 0549dd5fd7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -203,7 +203,7 @@ impl Ticker {
}
/// Waits for the next tick.
pub fn next(&mut self) -> impl Future<Output = ()> + '_ {
pub fn next(&mut self) -> impl Future<Output = ()> + Send + Sync + '_ {
poll_fn(|cx| {
if self.expires_at <= Instant::now() {
let dur = self.duration;