@@ -185,14 +185,14 @@ serde_json = "1.0"
185185rand = " 0.8"
186186
187187[build-dependencies ]
188- tonic-build = " *"
188+ tonic-prost- build = " *"
189189```
190190
191191Create a ` build.rs ` file at the root of your crate:
192192
193193``` rust
194194fn 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
774774Tonic's default code generation configuration is convenient for self contained examples and small
775775projects. However, there are some cases when we need a slightly different workflow. For example:
@@ -782,7 +782,7 @@ files in the default location.
782782More generally, whenever we want to keep our ` .proto ` definitions in a central place and generate
783783code 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
786786possibilities:
787787
7887881 ) 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
794794fn 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