Do not print error on adding, when exactly the same already exist, it ignores it then silently.

This commit is contained in:
Oleksandr Kozachuk
2023-02-02 10:54:08 +01:00
parent 464ac458d2
commit b3260e04fb
+4 -2
View File
@@ -94,8 +94,10 @@ impl<'a> LKEval<'a> {
let mut fix = false;
{
let pwname = &name.lock().borrow().name.to_string();
if state.db.get(pwname).is_some() {
out.e(format!("error: password {} already exist", pwname));
if let Some(oldname) = state.db.get(pwname) {
if name.lock().borrow().to_string() != oldname.lock().borrow().to_string() {
out.e(format!("error: password {} already exist", pwname));
}
} else {
state.db.insert(pwname.to_string(), name.clone());
fix = true;