From a0feaf40e7edda916935eafc8fea78c955c0ee9f Mon Sep 17 00:00:00 2001 From: Dongyoung Moon Date: Thu, 7 Aug 2025 17:29:01 +0900 Subject: [PATCH] Update protobuf-src example to avoid unsafe set_var --- prost-build/src/lib.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/prost-build/src/lib.rs b/prost-build/src/lib.rs index 52a595e83..30d3c9080 100644 --- a/prost-build/src/lib.rs +++ b/prost-build/src/lib.rs @@ -125,11 +125,12 @@ //! ### Compiling `protoc` from source //! //! To compile `protoc` from source you can use the `protobuf-src` crate and -//! set the correct environment variables. +//! set the path to `protoc`. //! ```no_run,ignore, rust -//! std::env::set_var("PROTOC", protobuf_src::protoc()); +//! let mut prost_build = prost_build::Config::new(); +//! prost_build.protoc_executable(protobuf_src::protoc()); //! -//! // Now compile your proto files via prost-build +//! // Now compile your proto files with the configuration //! ``` //! //! [`protobuf-src`]: https://docs.rs/protobuf-src