From 4a696e070659739becedb3df9af9eae696be33d9 Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Thu, 23 Apr 2026 08:00:43 -0400 Subject: [PATCH] simplify: inline rendered_config into execute The helper was a 2-line indirection with a single caller. Inline its body so the whole command fits in one function. Co-Authored-By: Claude Opus 4.7 (1M context) --- lib/crates/fabro-cli/src/commands/config/mod.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/crates/fabro-cli/src/commands/config/mod.rs b/lib/crates/fabro-cli/src/commands/config/mod.rs index b0d7b34c7..7dfe3c383 100644 --- a/lib/crates/fabro-cli/src/commands/config/mod.rs +++ b/lib/crates/fabro-cli/src/commands/config/mod.rs @@ -23,10 +23,7 @@ struct RenderedConfig { server: ServerSettings, } -async fn rendered_config( - args: &SettingsArgs, - base_ctx: &CommandContext, -) -> anyhow::Result { +pub(crate) async fn execute(args: &SettingsArgs, base_ctx: &CommandContext) -> anyhow::Result<()> { let ctx = base_ctx.with_target(&args.target)?; let user = fabro_config::UserSettings::resolve()?; let server = ctx @@ -34,11 +31,8 @@ async fn rendered_config( .await? .retrieve_resolved_server_settings() .await?; - serde_json::to_value(RenderedConfig { user, server }).map_err(Into::into) -} + let config = serde_json::to_value(RenderedConfig { user, server })?; -pub(crate) async fn execute(args: &SettingsArgs, base_ctx: &CommandContext) -> anyhow::Result<()> { - let config = Box::pin(rendered_config(args, base_ctx)).await?; if base_ctx.json_output() { print_json_pretty(&config)?; return Ok(());