From c06917feda8138622f880002ff3cf39a4eb3d786 Mon Sep 17 00:00:00 2001 From: James Kay Date: Sun, 1 Sep 2024 15:46:30 +0100 Subject: [PATCH] `linera-client`: clippy fixes --- linera-client/src/client_options.rs | 2 +- linera-client/src/persistent/indexed_db.rs | 7 +------ linera-client/src/persistent/mod.rs | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/linera-client/src/client_options.rs b/linera-client/src/client_options.rs index 1f2a339e6191..31db85d463c4 100644 --- a/linera-client/src/client_options.rs +++ b/linera-client/src/client_options.rs @@ -267,7 +267,7 @@ impl ClientOptions { #[cfg(not(with_persist))] impl ClientOptions { - pub fn wallet(&self) -> Result>, Error> { + pub async fn wallet(&self) -> Result>, Error> { #![allow(unreachable_code)] let _wallet = unimplemented!("No persistence backend selected for wallet; please use one of the `fs` or `indexed-db` features"); Ok(WalletState::new(persistent::Memory::new(_wallet))) diff --git a/linera-client/src/persistent/indexed_db.rs b/linera-client/src/persistent/indexed_db.rs index 2eb8a31fdb51..af59eb722607 100644 --- a/linera-client/src/persistent/indexed_db.rs +++ b/linera-client/src/persistent/indexed_db.rs @@ -55,12 +55,7 @@ impl IndexedDb { ) -> Result, Error> { let mut db_req = IdbDatabase::open_u32(DATABASE_NAME, 1)?; db_req.set_on_upgrade_needed(Some(|evt: &IdbVersionChangeEvent| -> Result<(), JsValue> { - if evt - .db() - .object_store_names() - .find(|n| n == STORE_NAME) - .is_none() - { + if !evt.db().object_store_names().any(|n| n == STORE_NAME) { evt.db().create_object_store(STORE_NAME)?; } Ok(()) diff --git a/linera-client/src/persistent/mod.rs b/linera-client/src/persistent/mod.rs index 87e1f4822106..0b3536752d75 100644 --- a/linera-client/src/persistent/mod.rs +++ b/linera-client/src/persistent/mod.rs @@ -35,7 +35,7 @@ pub trait LocalPersist: Deref { /// Get a mutable reference to the value. This is not expressed as a /// [`DerefMut`](std::ops::DerefMut) bound because it is discouraged to consume this - /// function! Instead, use [`mutate`]. + /// function! Instead, use `mutate`. fn as_mut(&mut self) -> &mut Self::Target; /// Saves the value to persistent storage.