summaryrefslogtreecommitdiffstats
path: root/futures/src/time.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2022-01-14 13:50:30 +0700
committerLibravatar GitHub <noreply@github.com>2022-01-14 13:50:30 +0700
commitb7bc169120d3447ead238e974007027a5152d341 (patch)
treec0c3f56883c7df0f05acdc602b21c7a0f100cc56 /futures/src/time.rs
parent15a13a76b4b0534d08afc0328b90267048e41b9d (diff)
parent34adeaa0810b3f36e47c2b63b0a09401a3cb878b (diff)
downloadiced-b7bc169120d3447ead238e974007027a5152d341.tar.gz
iced-b7bc169120d3447ead238e974007027a5152d341.tar.bz2
iced-b7bc169120d3447ead238e974007027a5152d341.zip
Merge pull request #1195 from iced-rs/fix/vulnerabilities
Fix `cargo-audit` vulnerabilities
Diffstat (limited to '')
-rw-r--r--futures/src/time.rs24
1 files changed, 8 insertions, 16 deletions
diff --git a/futures/src/time.rs b/futures/src/time.rs
index 86b4a4e7..0ece6f04 100644
--- a/futures/src/time.rs
+++ b/futures/src/time.rs
@@ -14,7 +14,7 @@ pub fn every<H: std::hash::Hasher, E>(
struct Every(std::time::Duration);
#[cfg(all(
- not(any(feature = "tokio_old", feature = "tokio", feature = "async-std")),
+ not(any(feature = "tokio", feature = "async-std")),
feature = "smol"
))]
impl<H, E> subscription::Recipe<H, E> for Every
@@ -67,7 +67,7 @@ where
}
#[cfg(all(
- any(feature = "tokio", feature = "tokio_old"),
+ feature = "tokio",
not(any(feature = "async-std", feature = "smol"))
))]
impl<H, E> subscription::Recipe<H, E> for Every
@@ -89,23 +89,15 @@ where
) -> futures::stream::BoxStream<'static, Self::Output> {
use futures::stream::StreamExt;
- #[cfg(feature = "tokio_old")]
- use tokio_old as tokio;
-
let start = tokio::time::Instant::now() + self.0;
let stream = {
- #[cfg(feature = "tokio")]
- {
- futures::stream::unfold(
- tokio::time::interval_at(start, self.0),
- |mut interval| async move {
- Some((interval.tick().await, interval))
- },
- )
- }
- #[cfg(feature = "tokio_old")]
- tokio::time::interval_at(start, self.0)
+ futures::stream::unfold(
+ tokio::time::interval_at(start, self.0),
+ |mut interval| async move {
+ Some((interval.tick().await, interval))
+ },
+ )
};
stream.map(tokio::time::Instant::into_std).boxed()