Skip to content

Commit a0feaf4

Browse files
committed
Update protobuf-src example to avoid unsafe set_var
1 parent 4030c50 commit a0feaf4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

prost-build/src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,12 @@
125125
//! ### Compiling `protoc` from source
126126
//!
127127
//! To compile `protoc` from source you can use the `protobuf-src` crate and
128-
//! set the correct environment variables.
128+
//! set the path to `protoc`.
129129
//! ```no_run,ignore, rust
130-
//! std::env::set_var("PROTOC", protobuf_src::protoc());
130+
//! let mut prost_build = prost_build::Config::new();
131+
//! prost_build.protoc_executable(protobuf_src::protoc());
131132
//!
132-
//! // Now compile your proto files via prost-build
133+
//! // Now compile your proto files with the configuration
133134
//! ```
134135
//!
135136
//! [`protobuf-src`]: https://docs.rs/protobuf-src

0 commit comments

Comments
 (0)