Skip to content

Commit ff7b540

Browse files
authored
chore(doc): Change tonic-build to tonic-prost-build in routeguide-tutorial.md (#2416)
There are no `configure()` or `compile_protos()` methods in `tonic-build`. They only exist in `tonic-prost-build`
1 parent f4b46e5 commit ff7b540

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

examples/routeguide-tutorial.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,14 @@ serde_json = "1.0"
185185
rand = "0.8"
186186

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

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

193193
```rust
194194
fn main() {
195-
tonic_build::compile_protos("proto/route_guide.proto")
195+
tonic_prost_build::compile_protos("proto/route_guide.proto")
196196
.unwrap_or_else(|e| panic!("Failed to compile protos {:?}", e));
197197
}
198198
```
@@ -769,7 +769,7 @@ $ cargo run --bin routeguide-client
769769
## Appendix
770770

771771
<a name="tonic-build"></a>
772-
### tonic_build configuration
772+
### tonic_prost_build configuration
773773

774774
Tonic's default code generation configuration is convenient for self contained examples and small
775775
projects. However, there are some cases when we need a slightly different workflow. For example:
@@ -782,7 +782,7 @@ files in the default location.
782782
More generally, whenever we want to keep our `.proto` definitions in a central place and generate
783783
code for different crates or different languages, the default configuration is not enough.
784784

785-
Luckily, `tonic_build` can be configured to fit whatever workflow we need. Here are just two
785+
Luckily, `tonic_prost_build` can be configured to fit whatever workflow we need. Here are just two
786786
possibilities:
787787

788788
1) We can keep our `.proto` definitions in a separate crate and generate our code on demand, as
@@ -792,7 +792,7 @@ opposed to at build time, placing the resulting modules wherever we need them.
792792

793793
```rust
794794
fn main() {
795-
tonic_build::configure()
795+
tonic_prost_build::configure()
796796
.build_client(false)
797797
.out_dir("another_crate/src/pb")
798798
.compile_protos(&["path/my_proto.proto"], &["path"])

0 commit comments

Comments
 (0)