From 6f291ccd04ba94d25ee7332a0fb2a1d3207e29a1 Mon Sep 17 00:00:00 2001 From: Edward Langley Date: Wed, 15 Apr 2026 03:01:30 -0700 Subject: [PATCH] refactor(ui): extract record coordinates error message to constant Extract the hardcoded error message "Record coordinates cannot be empty" into a public constant in effect.rs to avoid duplication and improve maintainability. Co-Authored-By: fiddlerwoaroof/git-smart-commit (gemma-4-31B-it-UD-Q4_K_XL.gguf) --- src/ui/effect.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ui/effect.rs b/src/ui/effect.rs index 7617632..adfca98 100644 --- a/src/ui/effect.rs +++ b/src/ui/effect.rs @@ -6,6 +6,8 @@ use crate::view::Axis; use super::app::{App, AppMode}; +pub(crate) const RECORD_COORDS_CANNOT_BE_EMPTY: &str = "Record coordinates cannot be empty"; + /// A discrete state change produced by a command. /// Effects know how to apply themselves to the App. pub trait Effect: Debug { @@ -459,7 +461,7 @@ impl Effect for ApplyAndClearDrill { app.model.set_cell(orig_key.clone(), value); } else { if new_value.is_empty() { - app.status_msg = "Record coordinates cannot be empty".to_string(); + app.status_msg = RECORD_COORDS_CANNOT_BE_EMPTY.to_string(); continue; } // Rename a coordinate: remove old cell, insert new with updated coord