Skip to content

Commit b4270f5

Browse files
committed
♻️ refactor: use consts instead of magic &str
1 parent 12b2c92 commit b4270f5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/popups/conventional_commit.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,9 +641,9 @@ impl DrawableComponent for ConventionalCommitPopup {
641641
.style(self.theme.title(true))
642642
.title(Span::styled(
643643
if self.seleted_commit_type.is_some() {
644-
"Emoji of commit"
644+
strings::POPUP_TITLE_CONVENTIONAL_COMMIT
645645
} else {
646-
"Type of commit"
646+
strings::POPUP_TITLE_GITMOJI
647647
},
648648
self.theme.title(true),
649649
))

src/strings.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ pub static PUSH_POPUP_STATES_DELTAS: &str = "deltas (2/3)";
2323
pub static PUSH_POPUP_STATES_PUSHING: &str = "pushing (3/3)";
2424
pub static PUSH_POPUP_STATES_TRANSFER: &str = "transfer";
2525
pub static PUSH_POPUP_STATES_DONE: &str = "done";
26+
pub const POPUP_TITLE_CONVENTIONAL_COMMIT: &str = "Type of Commit";
27+
pub const POPUP_TITLE_GITMOJI: &str = "Emoji of Commit";
2628

2729
pub static PUSH_TAGS_POPUP_MSG: &str = "Push Tags";
2830
pub static PUSH_TAGS_STATES_FETCHING: &str = "fetching";

0 commit comments

Comments
 (0)