fix: more std::env::vars -> std::env::vars_os fixes

This commit is contained in:
Michael Bolin
2025-12-08 17:36:04 -08:00
parent cacfd003ac
commit 402db13d17
10 changed files with 58 additions and 17 deletions

View File

@@ -214,7 +214,11 @@ impl ServerHandler for TestToolServer {
}
};
let env_snapshot: HashMap<String, String> = std::env::vars().collect();
let env_snapshot: HashMap<String, String> = std::env::vars_os()
.filter_map(|(key, val)| {
Some((key.into_string().ok()?, val.into_string().ok()?))
})
.collect();
let structured_content = json!({
"echo": format!("ECHOING: {}", args.message),
"env": env_snapshot.get("MCP_TEST_VALUE"),