Skip to content

Commit 2050c85

Browse files
bryantbiggsmxpv
authored andcommitted
chore: Update tonic and prost dependencies to latest
1 parent 4b8bd82 commit 2050c85

File tree

3 files changed

+25
-19
lines changed

3 files changed

+25
-19
lines changed

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@ nix = "0.29"
3535
oci-spec = "0.6"
3636
os_pipe = "1.1"
3737
prctl = "1.0.0"
38-
prost = "0.12"
39-
prost-build = "0.12"
40-
prost-types = "0.12"
38+
prost = "0.13"
39+
prost-build = "0.13"
40+
prost-types = "0.13"
4141
serde = { version = "1.0", features = ["derive"] }
4242
serde_json = "1.0"
4343
simple_logger = { version = "5.0", default-features = false }
4444
tempfile = "3.6"
4545
thiserror = "1.0"
4646
time = { version = "0.3.29", features = ["serde", "std", "formatting"] }
4747
tokio = "1.26"
48-
tonic = "0.11"
49-
tonic-build = "0.11"
48+
tonic = "0.12"
49+
tonic-build = "0.12"
5050
tower = "0.4"
5151
uuid = { version = "1.0", features = ["v4"] }

crates/client/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ name = "version"
2323
path = "examples/version.rs"
2424

2525
[dependencies]
26+
hyper-util = "0.1.6" # https://github.com/hyperium/hyper/issues/3110
2627
prost.workspace = true
2728
prost-types.workspace = true
2829
tokio = { workspace = true, optional = true }

crates/client/src/lib.rs

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -86,23 +86,28 @@ pub async fn connect(
8686

8787
let path = path.as_ref().to_path_buf();
8888

89-
// Taken from https://github.com/hyperium/tonic/blob/eeb3268f71ae5d1107c937392389db63d8f721fb/examples/src/uds/client.rs#L19
89+
// Taken from https://github.com/hyperium/tonic/blob/71fca362d7ffbb230547f23b3f2fb75c414063a8/examples/src/uds/client.rs#L21-L28
9090
// There will ignore this uri because uds do not use it
9191
// and make connection with UnixStream::connect.
92-
let channel = Endpoint::try_from("http://[::]")
93-
.unwrap()
92+
let channel = Endpoint::try_from("http://[::]")?
9493
.connect_with_connector(tower::service_fn(move |_| {
95-
#[cfg(unix)]
96-
{
97-
tokio::net::UnixStream::connect(path.clone())
98-
}
99-
100-
#[cfg(windows)]
101-
{
102-
let client = tokio::net::windows::named_pipe::ClientOptions::new()
103-
.open(path.clone())
104-
.map_err(|e| std::io::Error::from(e));
105-
async move { client }
94+
let path = path.clone();
95+
96+
async move {
97+
#[cfg(unix)]
98+
{
99+
Ok::<_, std::io::Error>(hyper_util::rt::TokioIo::new(
100+
tokio::net::UnixStream::connect(path).await?,
101+
))
102+
}
103+
104+
#[cfg(windows)]
105+
{
106+
let client = tokio::net::windows::named_pipe::ClientOptions::new()
107+
.open(path)
108+
.map_err(|e| std::io::Error::from(e));
109+
client.await
110+
}
106111
}
107112
}))
108113
.await?;

0 commit comments

Comments
 (0)