This commit is contained in:
John Smith
2021-11-27 21:05:36 -05:00
parent 45489d0e9c
commit ea8c75a29f
13 changed files with 37 additions and 37 deletions

View File

@@ -33,7 +33,7 @@ pub async fn save_user_secret_string(
let existed = kr.get_password().is_ok();
let _ = kr
.set_password(value)
.map_err(|e| format!("Failed to save user secret: {}", e).to_owned())?;
.map_err(|e| format!("Failed to save user secret: {}", e))?;
Ok(existed)
}
@@ -43,7 +43,7 @@ pub async fn load_user_secret_string(namespace: &str, key: &str) -> Result<Optio
match kr.get_password() {
Ok(v) => Ok(Some(v)),
Err(KeyringError::NoPasswordFound) => Ok(None),
Err(e) => Err(format!("Failed to load user secret: {}", e).to_owned()),
Err(e) => Err(format!("Failed to load user secret: {}", e)),
}
}
@@ -53,6 +53,6 @@ pub async fn remove_user_secret_string(namespace: &str, key: &str) -> Result<boo
match kr.delete_password() {
Ok(_) => Ok(true),
Err(KeyringError::NoPasswordFound) => Ok(false),
Err(e) => Err(format!("Failed to remove user secret: {}", e).to_owned()),
Err(e) => Err(format!("Failed to remove user secret: {}", e)),
}
}

View File

@@ -32,7 +32,7 @@ impl TableDB {
Self {
inner: Arc::new(Mutex::new(TableDBInner {
table,
table_store: table_store.clone(),
table_store,
database,
})),
}