Skip to content

Commit d67b944

Browse files
committed
chore: refactor environment variable management in tests by replacing env module with std::env for consistency, and remove unused McpConfig import in main.rs
1 parent 170716e commit d67b944

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/config.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ use figment::{
66
use serde::{Deserialize, Serialize};
77
use std::path::PathBuf;
88
use directories::ProjectDirs;
9-
use thiserror::Error;
10-
use toml;
119
use log;
12-
use std::env;
13-
use std::fs;
1410

1511
// Define a constant for the repository
1612
pub const GITHUB_REPO_OWNER: &str = "metacontract";
@@ -186,15 +182,15 @@ mod tests {
186182
use figment::Jail;
187183

188184
fn set_mc_project_root(path: &std::path::Path) -> Option<String> {
189-
let old = env::var("MC_PROJECT_ROOT").ok();
190-
env::set_var("MC_PROJECT_ROOT", path);
185+
let old = std::env::var("MC_PROJECT_ROOT").ok();
186+
std::env::set_var("MC_PROJECT_ROOT", path);
191187
old
192188
}
193189
fn restore_mc_project_root(old: Option<String>) {
194190
if let Some(val) = old {
195-
env::set_var("MC_PROJECT_ROOT", val);
191+
std::env::set_var("MC_PROJECT_ROOT", val);
196192
} else {
197-
env::remove_var("MC_PROJECT_ROOT");
193+
std::env::remove_var("MC_PROJECT_ROOT");
198194
}
199195
}
200196

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use tokio::{
1818

1919
// Import specific items needed in main
2020
use mc_mcp::config; // Keep for config loading
21-
use mc_mcp::config::McpConfig; // Keep for config type
21+
// use mc_mcp::config::McpConfig; // unused, remove
2222
use mc_mcp::initialization::initialize_background_services; // Use new initialization module
2323
use mc_mcp::server::handler::MyHandler; // Use new handler module
2424

0 commit comments

Comments
 (0)