Skip to content

Commit eb66b91

Browse files
easwarsLucioFranco
andauthored
examples: switch version to last released version (#2047)
As part of #2014, the versions of "tonic" and "tonic-build" were changed to "0.13". This breaks the instuctions in the examples documentation with an error like: ``` helloworld_tonic$ cargo run --bin helloworld-server Updating crates.io index error: failed to select a version for the requirement `tonic = "^0.13"` candidate versions found which didn't match: 0.12.3, 0.12.2, 0.12.1, ... location searched: crates.io index required by package `helloworld-tonic v0.1.0 (/usr/local/google/home/easwars/src/rust/projects/helloworld_tonic)` if you are looking for the prerelease package it needs to be specified explicitly tonic = { version = "0.1.0-beta.1" } ``` This PR changes the version of "tonic" and "tonic-build" to "*" which results in the latest version getting picked. Setting it to "*" also has the nice property of not having to update the examples everytime a version bump is required. Co-authored-by: Lucio Franco <luciofranco14@gmail.com>
1 parent 7220ecb commit eb66b91

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

examples/helloworld-tutorial.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ name = "helloworld-client"
112112
path = "src/client.rs"
113113

114114
[dependencies]
115-
tonic = "0.13"
115+
tonic = "*"
116116
prost = "0.13"
117117
tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] }
118118

119119
[build-dependencies]
120-
tonic-build = "0.13"
120+
tonic-build = "*"
121121
```
122122

123123
We include `tonic-build` as a useful way to incorporate the generation of our client and server gRPC code into the build process of our application. We will setup this build process now:

examples/routeguide-tutorial.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ Edit `Cargo.toml` and add all the dependencies we'll need for this example:
174174

175175
```toml
176176
[dependencies]
177-
tonic = "0.13"
177+
tonic = "*"
178178
prost = "0.13"
179179
tokio = { version = "1.0", features = ["rt-multi-thread", "macros", "sync", "time"] }
180180
tokio-stream = "0.1"
@@ -185,7 +185,7 @@ serde_json = "1.0"
185185
rand = "0.8"
186186

187187
[build-dependencies]
188-
tonic-build = "0.13"
188+
tonic-build = "*"
189189
```
190190

191191
Create a `build.rs` file at the root of your crate:

0 commit comments

Comments
 (0)