|
1 | 1 | // Copyright (c) Zefchain Labs, Inc.
|
2 | 2 | // SPDX-License-Identifier: Apache-2.0
|
3 | 3 |
|
4 |
| -use std::{fmt::Debug, sync::Arc}; |
| 4 | +use std::{fmt::Debug, rc::Rc}; |
5 | 5 |
|
6 | 6 | use futures::future;
|
7 | 7 | use indexed_db_futures::{js_sys, prelude::*, web_sys};
|
@@ -44,7 +44,7 @@ const DATABASE_NAME: &str = "linera";
|
44 | 44 | /// API](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API#:~:text=IndexedDB%20is%20a%20low%2Dlevel,larger%20amounts%20of%20structured%20data.).
|
45 | 45 | pub struct IndexedDbStore {
|
46 | 46 | /// The database used for storing the data.
|
47 |
| - pub database: Arc<IdbDatabase>, |
| 47 | + pub database: Rc<IdbDatabase>, |
48 | 48 | /// The object store name used for storing the data.
|
49 | 49 | pub object_store_name: String,
|
50 | 50 | /// The maximum number of queries used for the stream.
|
@@ -249,7 +249,7 @@ impl LocalAdminKeyValueStore for IndexedDbStore {
|
249 | 249 | }));
|
250 | 250 | database = db_req.await?;
|
251 | 251 | }
|
252 |
| - let database = Arc::new(database); |
| 252 | + let database = Rc::new(database); |
253 | 253 | let root_key = root_key.to_vec();
|
254 | 254 | Ok(IndexedDbStore {
|
255 | 255 | database,
|
@@ -374,11 +374,11 @@ pub enum IndexedDbStoreError {
|
374 | 374 | DatabaseConsistencyError(#[from] DatabaseConsistencyError),
|
375 | 375 |
|
376 | 376 | /// A DOM exception occurred in the IndexedDB operations
|
377 |
| - #[error("DOM exception: {}", self.to_string())] |
| 377 | + #[error("DOM exception: {0:?}")] |
378 | 378 | Dom(web_sys::DomException),
|
379 | 379 |
|
380 | 380 | /// JavaScript threw an exception whilst handling IndexedDB operations
|
381 |
| - #[error("JavaScript exception: {}", self.to_string())] |
| 381 | + #[error("JavaScript exception: {0:?}")] |
382 | 382 | Js(wasm_bindgen::JsValue),
|
383 | 383 | }
|
384 | 384 |
|
|
0 commit comments