From 28a85158c77dc8c8506f61238743aa491b97e3c2 Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Sat, 8 Nov 2025 16:46:01 +0100 Subject: [PATCH] shell_env: Wrap error context in format! where missing (#42267) Release Notes: - N/A --- crates/util/src/shell_env.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/util/src/shell_env.rs b/crates/util/src/shell_env.rs index de9e1a0b260d38de3b8a453100d0b81738daaa2f..7b8239007980158bb7e5d5956bebb4c5bfb576dd 100644 --- a/crates/util/src/shell_env.rs +++ b/crates/util/src/shell_env.rs @@ -93,7 +93,9 @@ async fn capture_unix( // Parse the JSON output from zed --printenv let env_map: collections::HashMap = serde_json::from_str(&env_output) - .with_context(|| "Failed to deserialize environment variables from json: {env_output}")?; + .with_context(|| { + format!("Failed to deserialize environment variables from json: {env_output}") + })?; Ok(env_map) } @@ -210,6 +212,7 @@ async fn capture_windows( let env_output = String::from_utf8_lossy(&output.stdout); // Parse the JSON output from zed --printenv - serde_json::from_str(&env_output) - .with_context(|| "Failed to deserialize environment variables from json: {env_output}") + serde_json::from_str(&env_output).with_context(|| { + format!("Failed to deserialize environment variables from json: {env_output}") + }) }