From e25ebf10674a6797257c3d72aa6f5e21ee6f9c46 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Thu, 7 May 2026 16:39:39 +0800 Subject: [PATCH] handle_command_not_found: extract constant --- src/parse_execution.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/parse_execution.rs b/src/parse_execution.rs index 0a454690c..1e249ce14 100644 --- a/src/parse_execution.rs +++ b/src/parse_execution.rs @@ -344,8 +344,9 @@ fn handle_command_not_found( )); io.append_from_specs(&list, L!("")); - if function::exists(L!("fish_command_not_found"), ctx.parser()) { - let mut buffer = L!("fish_command_not_found").to_owned(); + let function_name = L!("fish_command_not_found"); + if function::exists(function_name, ctx.parser()) { + let mut buffer = function_name.to_owned(); for arg in &event_args { buffer.push(' '); buffer.push_utfstr(&escape(arg)); @@ -353,7 +354,7 @@ fn handle_command_not_found( let parser = ctx.parser(); let prev_statuses = parser.last_statuses(); - let event = Event::generic(L!("fish_command_not_found").to_owned()); + let event = Event::generic(function_name.to_owned()); let b = parser.push_block(Block::event_block(event)); parser.eval(&buffer, &io); parser.pop_block(b);