From b4b467bdfcad12f08b8a8b7c1365c14d4080b77a Mon Sep 17 00:00:00 2001 From: Awiteb Date: Thu, 25 Apr 2024 01:25:11 +0300 Subject: [PATCH] chore: Fix lints errors --- src/cli/import_command.rs | 6 ++---- src/vault/mod.rs | 15 +++++++++------ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/cli/import_command.rs b/src/cli/import_command.rs index 2168ba3..f9de214 100644 --- a/src/cli/import_command.rs +++ b/src/cli/import_command.rs @@ -44,10 +44,8 @@ impl RunCommand for Import { { let imported_passwords_len = match self.format { Format::Lprs => { - let vaults = Vaults::try_reload( - self.path.to_path_buf(), - vault_manager.master_password.to_vec(), - )?; + let vaults = + Vaults::try_reload(self.path, vault_manager.master_password.to_vec())?; let vaults_len = vaults.vaults.len(); vault_manager.vaults.extend(vaults.vaults); diff --git a/src/vault/mod.rs b/src/vault/mod.rs index 55b4917..81c05d3 100644 --- a/src/vault/mod.rs +++ b/src/vault/mod.rs @@ -187,11 +187,14 @@ impl Vaults { } } -impl ToString for Format { - fn to_string(&self) -> String { - self.to_possible_value() - .expect("There is no skiped values") - .get_name() - .to_owned() +impl std::fmt::Display for Format { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!( + f, + "{}", + self.to_possible_value() + .expect("There is no skiped values") + .get_name() + ) } }