Skip to content

Commit b378bf8

Browse files
committed
Update protobuf-src example to avoid unsafe set_var
1 parent df814bb commit b378bf8

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
@@ -126,11 +126,12 @@
126126
//! ### Compiling `protoc` from source
127127
//!
128128
//! To compile `protoc` from source you can use the `protobuf-src` crate and
129-
//! set the correct environment variables.
129+
//! set the path to `protoc`.
130130
//! ```no_run,ignore, rust
131-
//! std::env::set_var("PROTOC", protobuf_src::protoc());
131+
//! let mut prost_build = prost_build::Config::new();
132+
//! prost_build.protoc_executable(protobuf_src::protoc());
132133
//!
133-
//! // Now compile your proto files via prost-build
134+
//! // Now compile your proto files with the configuration
134135
//! ```
135136
//!
136137
//! [`protobuf-src`]: https://docs.rs/protobuf-src

0 commit comments

Comments
 (0)