From f714f42414f50cdcd2cc975b279442cfae87103f Mon Sep 17 00:00:00 2001 From: ngoguey <9285880+Ngoguey42@users.noreply.github.com> Date: Thu, 25 Jan 2024 20:08:16 +0100 Subject: [PATCH] Repair rust-analyzer for tonic files (#1604) --- tonic-build/src/prost.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tonic-build/src/prost.rs b/tonic-build/src/prost.rs index 3202e2730..dafbe9814 100644 --- a/tonic-build/src/prost.rs +++ b/tonic-build/src/prost.rs @@ -541,13 +541,9 @@ impl Builder { protos: &[impl AsRef], includes: &[impl AsRef], ) -> io::Result<()> { - let out_dir = if let Some(out_dir) = self.out_dir.as_ref() { - out_dir.clone() - } else { - PathBuf::from(std::env::var("OUT_DIR").unwrap()) - }; - - config.out_dir(out_dir); + if let Some(out_dir) = self.out_dir.as_ref() { + config.out_dir(out_dir); + } if let Some(path) = self.file_descriptor_set_path.as_ref() { config.file_descriptor_set_path(path); }