Skip to content

Commit 8748fb8

Browse files
shaun-coxdjc
authored andcommitted
use futures-util instead of futures and with no default features
1 parent d6f0cfc commit 8748fb8

File tree

8 files changed

+14
-15
lines changed

8 files changed

+14
-15
lines changed

opentelemetry-contrib/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ tokio = { version = "1.0", features = ["fs", "io-util"], optional = true }
4040

4141
# futures
4242
futures-core = { version = "0.3", optional = true }
43-
futures-util = { version = "0.3", optional = true }
43+
futures-util = { version = "0.3", optional = true, default-features = false }
4444

4545
[dev-dependencies]
4646
base64 = "0.13"

opentelemetry-datadog/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ futures-core = "0.3"
4343
async-trait = "0.1"
4444
base64 = "0.13"
4545
bytes = "1"
46-
futures-util = { version = "0.3", features = ["io"] }
46+
futures-util = { version = "0.3", default-features = false, features = ["io"] }
4747
isahc = "1.4"
4848
opentelemetry_sdk = { path = "../opentelemetry-sdk", features = ["trace", "testing"] }
4949

opentelemetry-dynatrace/Cargo.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,10 @@ surf-client = ["surf", "opentelemetry-http/surf"]
3636
isahc-client = ["isahc", "opentelemetry-http/isahc"]
3737

3838
rt-tokio = ["tokio", "opentelemetry/rt-tokio"]
39-
rt-async-std = ["async-std"]
39+
rt-async-std = ["async-std", "futures-channel"]
4040

4141
wasm = [
4242
"base64",
43-
"futures-util",
4443
"getrandom/js",
4544
"js-sys",
4645
"wasm-bindgen",
@@ -51,8 +50,7 @@ wasm = [
5150
[dependencies]
5251
async-std = { version = "= 1.10.0", features = ["unstable"], optional = true }
5352
base64 = { version = "0.21", optional = true }
54-
futures = "0.3"
55-
futures-util = { version = "0.3", optional = true }
53+
futures-channel = { version = "0.3", optional = true }
5654
getrandom = { version = "0.2", optional = true }
5755
http = "0.2"
5856
isahc = { version = "1.4", default-features = false, optional = true }
@@ -82,5 +80,6 @@ optional = true
8280

8381
[dev-dependencies]
8482
opentelemetry_sdk = { version = "0.19.0", features = ["rt-tokio"] }
83+
futures-util = { version = "0.3", default-features = false }
8584
tokio = { version = "1.0", default-features = false, features = ["macros", "rt-multi-thread", "sync", "test-util"] }
8685
hyper = { version = "0.14", default-features = false, features = ["server", "tcp", "http1"] }

opentelemetry-dynatrace/src/metric.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ pub struct MetricsExporter {
233233
sender: Arc<Mutex<tokio::sync::mpsc::Sender<ClientMessage>>>,
234234

235235
#[cfg(all(not(feature = "rt-tokio"), feature = "rt-async-std"))]
236-
sender: Arc<Mutex<futures::channel::mpsc::Sender<ClientMessage>>>,
236+
sender: Arc<Mutex<futures_channel::mpsc::Sender<ClientMessage>>>,
237237

238238
endpoint: Uri,
239239

@@ -292,7 +292,7 @@ impl MetricsExporter {
292292
}));
293293

294294
#[cfg(all(not(feature = "rt-tokio"), feature = "rt-async-std"))]
295-
let (sender, mut receiver) = futures::channel::mpsc::channel::<ClientMessage>(2);
295+
let (sender, mut receiver) = futures_channel::mpsc::channel::<ClientMessage>(2);
296296

297297
#[cfg(all(not(feature = "rt-tokio"), feature = "rt-async-std"))]
298298
async_std::task::spawn(Box::pin(async move {

opentelemetry-dynatrace/tests/http_test.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#[cfg(all(feature = "metrics", feature = "rt-tokio"))]
22
mod test {
3-
use futures::future::BoxFuture;
3+
use futures_util::future::BoxFuture;
44
use http::header::{HeaderValue, AUTHORIZATION, USER_AGENT};
55
use hyper::{
66
body,
@@ -20,18 +20,18 @@ mod test {
2020
tick_rx: tokio::sync::watch::Receiver<usize>,
2121
}
2222
impl runtime::Runtime for TestRuntime {
23-
type Interval = futures::stream::Once<BoxFuture<'static, ()>>;
23+
type Interval = futures_util::stream::Once<BoxFuture<'static, ()>>;
2424

2525
type Delay = Pin<Box<tokio::time::Sleep>>;
2626

2727
fn interval(&self, _duration: Duration) -> Self::Interval {
2828
let mut tick_rx = self.tick_rx.clone();
29-
futures::stream::once(Box::pin(async move {
29+
futures_util::stream::once(Box::pin(async move {
3030
let _ = tick_rx.changed().await.is_ok();
3131
}))
3232
}
3333

34-
fn spawn(&self, future: futures::future::BoxFuture<'static, ()>) {
34+
fn spawn(&self, future: BoxFuture<'static, ()>) {
3535
tokio::spawn(future);
3636
}
3737

opentelemetry-otlp/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ tokio-stream = { version = "0.1", features = ["net"] }
5151
opentelemetry_sdk = { features = ["trace", "rt-tokio", "testing"], path = "../opentelemetry-sdk" }
5252
time = { version = "0.3", features = ["macros"] }
5353
tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] }
54-
futures = { version = "0.3", default-features = false, features = ["std"] }
54+
futures-util = { version = "0.3", default-features = false }
5555

5656
[features]
5757
# telemetry pillars and functions

opentelemetry-otlp/tests/smoke.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use futures::StreamExt;
1+
use futures_util::StreamExt;
22
use opentelemetry::global::shutdown_tracer_provider;
33
use opentelemetry::trace::{Span, SpanKind, Tracer};
44
use opentelemetry_otlp::WithExportConfig;

opentelemetry-stackdriver/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ tempfile = "3.3.0"
4242
tokio = "1"
4343
tonic-build = "0.9.0"
4444
walkdir = "2.3.2"
45-
futures = "0.3"
45+
futures-util = {version = "0.3", default-features = false }

0 commit comments

Comments
 (0)