From 9e0addbb148d29d134d563222467eebf9f0cc9b5 Mon Sep 17 00:00:00 2001 From: Colin Lienard <64312634+colinlienard@users.noreply.github.com> Date: Tue, 16 Jul 2024 15:45:03 +0200 Subject: [PATCH] feat: trim inputs (#19) --- src/config.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/config.rs b/src/config.rs index 8c53b6b..71e5fce 100644 --- a/src/config.rs +++ b/src/config.rs @@ -117,13 +117,14 @@ impl Config { let name = Text::new("Name:") .with_validators(&[Box::new(get_not_empty_validator())]) .prompt()?; + let name = name.trim(); let commit_name = match scope { Some(scope) => { if scope.is_empty() { format!("{}: {}", _type, name) } else { - format!("{}({}): {}", _type, scope, name) + format!("{}({}): {}", _type, scope.trim(), name) } } None => format!("{}: {}", _type, name),