storkit: merge 441_refactor_deduplicate_get_project_root_wrappers_in_io_modules

This commit is contained in:
dave
2026-03-28 16:42:55 +00:00
parent bfe70f5599
commit 96793de11b
2 changed files with 2 additions and 11 deletions
+1 -5
View File
@@ -11,15 +11,11 @@ pub struct SearchResult {
pub matches: usize,
}
fn get_project_root(state: &SessionState) -> Result<PathBuf, String> {
state.get_project_root()
}
pub async fn search_files(
query: String,
state: &SessionState,
) -> Result<Vec<SearchResult>, String> {
let root = get_project_root(state)?;
let root = state.get_project_root()?;
search_files_impl(query, root).await
}
+1 -6
View File
@@ -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<PathBuf, String> {
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<String>,
state: &SessionState,
) -> Result<CommandOutput, String> {
let root = get_project_root(state)?;
let root = state.get_project_root()?;
exec_shell_impl(command, args, root).await
}