From f7f3b2578fce3401d5801434033c26253fa2ff28 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 22 Sep 2026 07:39:32 +0000 Subject: [PATCH] Remove deprecated std::env::home_dir usages Replaces `std::env::home_dir()` calls with `dirs::home_dir()` across the CLI crate. This includes stripping out redundant local `mod dirs` wrappers that were shadowing the external crate in `repl.rs`, `doctor.rs`, and `config.rs`. Co-authored-by: Tcode-Motion <188012755+Tcode-Motion@users.noreply.github.com> --- cli/src/commands/clean.rs | 7 +------ cli/src/commands/doctor.rs | 8 -------- cli/src/commands/repl.rs | 8 -------- cli/src/config.rs | 8 -------- 4 files changed, 1 insertion(+), 30 deletions(-) diff --git a/cli/src/commands/clean.rs b/cli/src/commands/clean.rs index 0ee9de97..e9f9ad39 100644 --- a/cli/src/commands/clean.rs +++ b/cli/src/commands/clean.rs @@ -26,7 +26,7 @@ pub fn execute(all: bool) -> ExitCode { if all { println!("Cleaning global package caches..."); - if let Some(home) = home_dir() { + if let Some(home) = dirs::home_dir() { let cache_dir = home.join(".techscript").join("cache"); if cache_dir.exists() { if std::fs::remove_dir_all(&cache_dir).is_ok() { @@ -49,8 +49,3 @@ pub fn execute(all: bool) -> ExitCode { ExitCode::IoError } } - -fn home_dir() -> Option { - #[allow(deprecated)] - std::env::home_dir() -} diff --git a/cli/src/commands/doctor.rs b/cli/src/commands/doctor.rs index 243aa876..088fbb4c 100644 --- a/cli/src/commands/doctor.rs +++ b/cli/src/commands/doctor.rs @@ -300,11 +300,3 @@ pub fn execute(fix: bool) -> ExitCode { ExitCode::CompilationError } } - -mod dirs { - use std::path::PathBuf; - pub fn home_dir() -> Option { - #[allow(deprecated)] - std::env::home_dir() - } -} diff --git a/cli/src/commands/repl.rs b/cli/src/commands/repl.rs index 35108267..f12fe4a1 100644 --- a/cli/src/commands/repl.rs +++ b/cli/src/commands/repl.rs @@ -271,11 +271,3 @@ fn dump_repl_bytecode(expr: &str) { } } } - -mod dirs { - use std::path::PathBuf; - pub fn home_dir() -> Option { - #[allow(deprecated)] - std::env::home_dir() - } -} diff --git a/cli/src/config.rs b/cli/src/config.rs index 3c6de852..f491b8ac 100644 --- a/cli/src/config.rs +++ b/cli/src/config.rs @@ -257,11 +257,3 @@ fn apply_cli(base: &mut EffectiveConfig, cli: &CliConfig) { base.parallel_jobs = jobs; } } - -mod dirs { - use std::path::PathBuf; - pub fn home_dir() -> Option { - #[allow(deprecated)] - std::env::home_dir() - } -}