Skip to content

Commit b7f6262

Browse files
committed
build(rs-nats): only support a single async-nats version
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
1 parent 704b707 commit b7f6262

File tree

14 files changed

+511
-749
lines changed

14 files changed

+511
-749
lines changed

Cargo.lock

Lines changed: 495 additions & 669 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,7 @@ wit-bindgen-wrpc-rust = { workspace = true, optional = true }
8080
wrpc-cli = { workspace = true, optional = true }
8181
wrpc-runtime-wasmtime = { workspace = true, optional = true }
8282
wrpc-transport = { workspace = true }
83-
wrpc-transport-nats = { workspace = true, features = [
84-
"async-nats-0_41",
85-
], optional = true }
83+
wrpc-transport-nats = { workspace = true, optional = true }
8684
wrpc-transport-quic = { workspace = true, optional = true }
8785
wrpc-transport-web = { workspace = true, optional = true }
8886
wrpc-wasmtime-cli = { workspace = true, optional = true }

crates/transport-nats/Cargo.toml

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,9 @@ edition.workspace = true
99
license.workspace = true
1010
repository.workspace = true
1111

12-
[features]
13-
default = ["async-nats-0_41"]
14-
1512
[dependencies]
1613
anyhow = { workspace = true, features = ["std"] }
17-
async-nats-0_41 = { package = "async-nats", version = "0.41", default-features = false, features = [
18-
"ring",
19-
], optional = true }
20-
async-nats-0_40 = { package = "async-nats", version = "0.40", default-features = false, features = [
21-
"ring",
22-
], optional = true }
23-
async-nats-0_39 = { package = "async-nats", version = "0.39", default-features = false, features = [
24-
"ring",
25-
], optional = true }
26-
async-nats-0_38 = { package = "async-nats", version = "0.38", default-features = false, features = [
27-
"ring",
28-
], optional = true }
29-
async-nats-0_37 = { package = "async-nats", version = "0.37", default-features = false, features = [
30-
"ring",
31-
], optional = true }
32-
async-nats-0_36 = { package = "async-nats", version = "0.36", default-features = false, features = [
33-
"ring",
34-
], optional = true }
14+
async-nats = { workspace = true, features = ["ring"] }
3515
bytes = { workspace = true }
3616
futures = { workspace = true, features = ["async-await"] }
3717
nuid = { workspace = true }

crates/transport-nats/src/lib.rs

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2,53 +2,6 @@
22
33
#![allow(clippy::type_complexity)]
44

5-
#[cfg(any(
6-
not(any(
7-
feature = "async-nats-0_41",
8-
feature = "async-nats-0_40",
9-
feature = "async-nats-0_39",
10-
feature = "async-nats-0_38",
11-
feature = "async-nats-0_37",
12-
feature = "async-nats-0_36",
13-
)),
14-
all(feature = "async-nats-0_41", feature = "async-nats-0_40"),
15-
all(feature = "async-nats-0_41", feature = "async-nats-0_39"),
16-
all(feature = "async-nats-0_41", feature = "async-nats-0_38"),
17-
all(feature = "async-nats-0_41", feature = "async-nats-0_37"),
18-
all(feature = "async-nats-0_41", feature = "async-nats-0_36"),
19-
all(feature = "async-nats-0_40", feature = "async-nats-0_39"),
20-
all(feature = "async-nats-0_40", feature = "async-nats-0_38"),
21-
all(feature = "async-nats-0_40", feature = "async-nats-0_37"),
22-
all(feature = "async-nats-0_40", feature = "async-nats-0_36"),
23-
all(feature = "async-nats-0_39", feature = "async-nats-0_38"),
24-
all(feature = "async-nats-0_39", feature = "async-nats-0_37"),
25-
all(feature = "async-nats-0_39", feature = "async-nats-0_36"),
26-
all(feature = "async-nats-0_38", feature = "async-nats-0_37"),
27-
all(feature = "async-nats-0_38", feature = "async-nats-0_36"),
28-
all(feature = "async-nats-0_37", feature = "async-nats-0_36"),
29-
))]
30-
compile_error!(
31-
"Either feature \"async-nats-0_41\", \"async-nats-0_40\", \"async-nats-0_39\", \"async-nats-0_38\", \"async-nats-0_37\" or \"async-nats-0_36\" must be enabled for this crate."
32-
);
33-
34-
#[cfg(feature = "async-nats-0_41")]
35-
use async_nats_0_41 as async_nats;
36-
37-
#[cfg(feature = "async-nats-0_40")]
38-
use async_nats_0_40 as async_nats;
39-
40-
#[cfg(feature = "async-nats-0_39")]
41-
use async_nats_0_39 as async_nats;
42-
43-
#[cfg(feature = "async-nats-0_38")]
44-
use async_nats_0_38 as async_nats;
45-
46-
#[cfg(feature = "async-nats-0_37")]
47-
use async_nats_0_37 as async_nats;
48-
49-
#[cfg(feature = "async-nats-0_36")]
50-
use async_nats_0_36 as async_nats;
51-
525
use core::future::Future;
536
use core::iter::zip;
547
use core::ops::{Deref, DerefMut};

crates/transport-quic/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl wrpc_transport::frame::ConnHandler<RecvStream, SendStream> for ConnHandler
3131
}
3232
}
3333

34-
async fn on_egress(mut tx: SendStream, res: std::io::Result<()>) {
34+
async fn on_egress(tx: SendStream, res: std::io::Result<()>) {
3535
if let Err(err) = res {
3636
error!(?err, "egress failed");
3737
} else {

crates/wasmtime-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,6 @@ wasmtime-wasi = { workspace = true }
6767
wasmtime-wasi-http = { workspace = true }
6868
wit-component = { workspace = true }
6969
wrpc-cli = { workspace = true, features = ["nats"] }
70-
wrpc-transport-nats = { workspace = true, features = ["async-nats-0_41"] }
70+
wrpc-transport-nats = { workspace = true }
7171
wrpc-transport = { workspace = true, features = ["net"] }
7272
wrpc-runtime-wasmtime = { workspace = true }

examples/rust/hello-nats-client/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ tokio = { workspace = true, features = ["rt-multi-thread"] }
2424
tracing-subscriber = { workspace = true, features = ["ansi", "fmt"] }
2525
url = { workspace = true }
2626
wit-bindgen-wrpc = { workspace = true }
27-
wrpc-transport-nats = { workspace = true, features = ["async-nats-0_41"] }
27+
wrpc-transport-nats = { workspace = true }

examples/rust/hello-nats-server/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ tracing = { workspace = true }
2626
tracing-subscriber = { workspace = true, features = ["ansi", "fmt"] }
2727
url = { workspace = true }
2828
wit-bindgen-wrpc = { workspace = true }
29-
wrpc-transport-nats = { workspace = true, features = ["async-nats-0_41"] }
29+
wrpc-transport-nats = { workspace = true }

examples/rust/streams-nats-client/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ tracing-subscriber = { workspace = true, features = [
3232
] }
3333
url = { workspace = true }
3434
wit-bindgen-wrpc = { workspace = true }
35-
wrpc-transport-nats = { workspace = true, features = ["async-nats-0_41"] }
35+
wrpc-transport-nats = { workspace = true }

examples/rust/streams-nats-server/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ tracing-subscriber = { workspace = true, features = [
3131
] }
3232
url = { workspace = true }
3333
wit-bindgen-wrpc = { workspace = true }
34-
wrpc-transport-nats = { workspace = true, features = ["async-nats-0_41"] }
34+
wrpc-transport-nats = { workspace = true }

0 commit comments

Comments
 (0)