chore: Trim the added vault name

This commit is contained in:
Awiteb 2024-05-10 17:58:59 +03:00
parent 095aa37219
commit 31afe4fd58
Signed by: awiteb
GPG key ID: 3F6B55640AA6682F

View file

@ -50,6 +50,7 @@ pub struct Add {
impl LprsCommand for Add {
fn run(mut self, mut vault_manager: Vaults) -> LprsResult<()> {
if !self.vault_info.is_empty() {
self.vault_info.name = self.vault_info.name.trim().to_string();
self.vault_info.password = utils::user_password(self.password, "Vault password:")?;
self.vault_info.custom_fields = self.custom_fields.into_iter().collect();
vault_manager.add_vault(self.vault_info);