From 4783f1a82a3f3132f15cb4a20768fd558bd7c708 Mon Sep 17 00:00:00 2001 From: Marko Atanasievski Date: Fri, 7 Jun 2024 10:47:40 +0200 Subject: [PATCH] fix: use futures iterator instead of tokio-stream --- Cargo.lock | 1 - Cargo.toml | 1 - common/Cargo.toml | 1 - common/src/block_interval.rs | 4 ++-- 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1d345def..f8aef11f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1235,7 +1235,6 @@ dependencies = [ "serde_json", "thiserror", "tokio", - "tokio-stream", "tracing", ] diff --git a/Cargo.toml b/Cargo.toml index 6b650c35..a34224fd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,6 @@ tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } clap = { version = "4.4.6", features = ["derive", "env"] } tokio = { version = "1.33.0", features = ["full"] } -tokio-stream = "0.1.15" serde = "1.0.183" serde_path_to_error = "0.1.14" serde_json = "1.0.107" diff --git a/common/Cargo.toml b/common/Cargo.toml index 43192f80..67989744 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -20,6 +20,5 @@ serde = { workspace = true } serde_json = { workspace = true } futures = { workspace = true } tokio = { workspace = true } -tokio-stream = { workspace = true } alloy = { workspace = true } async-stream = "0.3.5" diff --git a/common/src/block_interval.rs b/common/src/block_interval.rs index 8bd6ccb0..12b123f4 100644 --- a/common/src/block_interval.rs +++ b/common/src/block_interval.rs @@ -117,9 +117,9 @@ impl BlockInterval { let num = num .as_number() .ok_or(BlockIntervalError::InvalidBlockNumber(num.to_string()))?; - Ok(tokio_stream::iter(num..num + 1)) + Ok(futures::stream::iter(num..num + 1)) } - BlockInterval::Range(range) => Ok(tokio_stream::iter(range)), + BlockInterval::Range(range) => Ok(futures::stream::iter(range)), _ => Err(BlockIntervalError::IntoBoundedStreamError), } }