Drop three trait imports Android does not need
The Linux store is built on `keyring::Entry`, whose set_password, get_password and delete_credential are inherent methods. The Android one is built on `keyring_core::Entry`, where they are inherent too -- so the `CredentialApi` import that each of its three methods opened with was doing nothing, and said so on every Android build. `CredentialStoreApi` a few lines above is a different matter and stays: `build` really does come from that trait. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -222,22 +222,16 @@ impl Default for PlatformSecretStore {
|
||||
#[cfg(target_os = "android")]
|
||||
impl SecretStore for PlatformSecretStore {
|
||||
fn store(&self, secret_ref: &SecretRef, secret: &str) -> Result<(), SecretError> {
|
||||
use keyring_core::api::CredentialApi;
|
||||
|
||||
self.entry(secret_ref)?
|
||||
.set_password(secret)
|
||||
.map_err(map_err)
|
||||
}
|
||||
|
||||
fn retrieve(&self, secret_ref: &SecretRef) -> Result<String, SecretError> {
|
||||
use keyring_core::api::CredentialApi;
|
||||
|
||||
self.entry(secret_ref)?.get_password().map_err(map_err)
|
||||
}
|
||||
|
||||
fn delete(&self, secret_ref: &SecretRef) -> Result<(), SecretError> {
|
||||
use keyring_core::api::CredentialApi;
|
||||
|
||||
match self.entry(secret_ref)?.delete_credential() {
|
||||
Ok(()) => Ok(()),
|
||||
// Logout must be idempotent, as on Linux.
|
||||
|
||||
Reference in New Issue
Block a user