From 96793de11b3d48a7a640d8248fdba9476264ac2a Mon Sep 17 00:00:00 2001 From: dave Date: Sat, 28 Mar 2026 16:42:55 +0000 Subject: [PATCH] storkit: merge 441_refactor_deduplicate_get_project_root_wrappers_in_io_modules --- server/src/io/search.rs | 6 +----- server/src/io/shell.rs | 7 +------ 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/server/src/io/search.rs b/server/src/io/search.rs index 2c60280d..8225fac3 100644 --- a/server/src/io/search.rs +++ b/server/src/io/search.rs @@ -11,15 +11,11 @@ pub struct SearchResult { pub matches: usize, } -fn get_project_root(state: &SessionState) -> Result { - state.get_project_root() -} - pub async fn search_files( query: String, state: &SessionState, ) -> Result, String> { - let root = get_project_root(state)?; + let root = state.get_project_root()?; search_files_impl(query, root).await } diff --git a/server/src/io/shell.rs b/server/src/io/shell.rs index 66f6e629..a554382c 100644 --- a/server/src/io/shell.rs +++ b/server/src/io/shell.rs @@ -3,11 +3,6 @@ use serde::Serialize; use std::path::PathBuf; use std::process::Command; -/// Helper to get the root path (cloned) without joining -fn get_project_root(state: &SessionState) -> Result { - state.get_project_root() -} - #[derive(Serialize, Debug, poem_openapi::Object)] pub struct CommandOutput { pub stdout: String, @@ -53,7 +48,7 @@ pub async fn exec_shell( args: Vec, state: &SessionState, ) -> Result { - let root = get_project_root(state)?; + let root = state.get_project_root()?; exec_shell_impl(command, args, root).await }