From aeaa7b9f135991ce8fda6e5a3305a9596bd3bfb5 Mon Sep 17 00:00:00 2001 From: daisuke8000 Date: Sun, 5 Jul 2026 17:29:41 +0900 Subject: [PATCH] Remove map_run_resolution_error passthrough (DSK-126) Inline err.to_string() at three call sites instead of a one-line wrapper function. Co-authored-by: Cursor --- src/run_defaults.rs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/run_defaults.rs b/src/run_defaults.rs index b46f47b..1e412ac 100644 --- a/src/run_defaults.rs +++ b/src/run_defaults.rs @@ -1,8 +1,8 @@ //! Thin CLI → core mapper for pod query and namespace resolution. use rustern_core::discovery::run_resolution::{ - RunResolutionError, RunResolutionInput, RunResolutionOutput, resolve_run_input, - resolve_run_namespaces, resolve_run_query, + RunResolutionInput, RunResolutionOutput, resolve_run_input, resolve_run_namespaces, + resolve_run_query, }; use crate::cli::Cli; @@ -18,25 +18,21 @@ fn run_resolution_input(cli: &Cli) -> RunResolutionInput<'_> { } } -fn map_run_resolution_error(err: RunResolutionError) -> String { - err.to_string() -} - /// Resolve pod query, namespaces, and validation in one call. pub fn resolved_run(cli: &Cli) -> Result { resolve_run_input(&run_resolution_input(cli), &cli.context_selector()) - .map_err(map_run_resolution_error) + .map_err(|e| e.to_string()) } /// Resolve the pod query positional, applying stern-like defaults. pub fn resolved_pod_query(cli: &Cli) -> Result { - resolve_run_query(&run_resolution_input(cli)).map_err(map_run_resolution_error) + resolve_run_query(&run_resolution_input(cli)).map_err(|e| e.to_string()) } /// Resolve namespace scope: `-A` → empty; explicit `-n` → deduped list; else active context namespace. pub fn resolved_namespaces(cli: &Cli) -> Result, String> { resolve_run_namespaces(&run_resolution_input(cli), &cli.context_selector()) - .map_err(map_run_resolution_error) + .map_err(|e| e.to_string()) } #[cfg(test)]