From 9639780250a6f2149f4248dba63feb8498278357 Mon Sep 17 00:00:00 2001 From: Brian3647 Date: Sun, 29 Oct 2023 20:17:52 +0200 Subject: [PATCH] refactor: Make add file prompt better --- src/commit_type.rs | 8 ++++---- src/prompt.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/commit_type.rs b/src/commit_type.rs index 10f2a83..ce265a4 100644 --- a/src/commit_type.rs +++ b/src/commit_type.rs @@ -10,7 +10,7 @@ pub enum CommitType { Refactor, Perf, Test, - Chore + Chore, } // Return a description of the commit type @@ -20,11 +20,11 @@ impl Display for CommitType { CommitType::Feat => "A new feature", CommitType::Fix => "A bug fix", CommitType::Docs => "Documentation updates", - CommitType::Style => "Changes dat do not affect the meaning of the code", + CommitType::Style => "Changes that do not affect the meaning of the code", CommitType::Refactor => "A code change that neither fixes a bug or adds a feature", CommitType::Perf => "A code change that improves performance", CommitType::Test => "Adding or updating tests", - CommitType::Chore => "Changes to the build process or auxiliary tools" + CommitType::Chore => "Changes to the build process or auxiliary tools", }) } } @@ -42,7 +42,7 @@ impl From for CommitType { "fix:" => Self::Fix, "feat:" => Self::Feat, // Unreachable. - _ => panic!("Unknown commit type {}", x) + _ => panic!("Unknown commit type {}", x), } } } diff --git a/src/prompt.rs b/src/prompt.rs index 0ec10ae..d17605b 100644 --- a/src/prompt.rs +++ b/src/prompt.rs @@ -60,5 +60,5 @@ pub fn get_commit_type() -> InquireResult { } pub fn confirm(m: &str) -> InquireResult { - Confirm::new(m).prompt() + Confirm::new(m).with_default(true).prompt() }