Skip to content

Commit

Permalink
Rename IndexeddbCryptoStoreError::Json -> Serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
richvdh committed Nov 27, 2023
1 parent 0f16ad6 commit a4c46b1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/matrix-sdk-indexeddb/src/crypto_store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ impl std::fmt::Debug for IndexeddbCryptoStore {
#[derive(Debug, thiserror::Error)]
pub enum IndexeddbCryptoStoreError {
#[error(transparent)]
Json(#[from] serde_json::Error),
Serialization(#[from] serde_json::Error),
#[error("DomException {name} ({code}): {message}")]
DomException {
/// DomException code
Expand All @@ -140,14 +140,14 @@ impl From<indexed_db_futures::web_sys::DomException> for IndexeddbCryptoStoreErr

impl From<serde_wasm_bindgen::Error> for IndexeddbCryptoStoreError {
fn from(e: serde_wasm_bindgen::Error) -> Self {
IndexeddbCryptoStoreError::Json(serde::de::Error::custom(e.to_string()))
IndexeddbCryptoStoreError::Serialization(serde::de::Error::custom(e.to_string()))
}
}

impl From<IndexeddbCryptoStoreError> for CryptoStoreError {
fn from(frm: IndexeddbCryptoStoreError) -> CryptoStoreError {
match frm {
IndexeddbCryptoStoreError::Json(e) => CryptoStoreError::Serialization(e),
IndexeddbCryptoStoreError::Serialization(e) => CryptoStoreError::Serialization(e),
IndexeddbCryptoStoreError::CryptoStoreError(e) => e,
_ => CryptoStoreError::backend(frm),
}
Expand Down

0 comments on commit a4c46b1

Please sign in to comment.