From 987d87cd5d84e20d48cd72f5198416c5c427c745 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Tue, 1 Sep 2020 17:41:30 +0200 Subject: [PATCH] crypto: Use the correct async-trait macro for the CryptoStores. --- matrix_sdk_crypto/src/store/memorystore.rs | 2 +- matrix_sdk_crypto/src/store/mod.rs | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/matrix_sdk_crypto/src/store/memorystore.rs b/matrix_sdk_crypto/src/store/memorystore.rs index 2bccfb38..087f720a 100644 --- a/matrix_sdk_crypto/src/store/memorystore.rs +++ b/matrix_sdk_crypto/src/store/memorystore.rs @@ -14,12 +14,12 @@ use std::{collections::HashSet, sync::Arc}; -use async_trait::async_trait; use dashmap::{DashMap, DashSet}; use matrix_sdk_common::{ identifiers::{DeviceId, RoomId, UserId}, locks::Mutex, }; +use matrix_sdk_common_macros::async_trait; use super::{Account, CryptoStore, InboundGroupSession, Result, Session}; use crate::{ diff --git a/matrix_sdk_crypto/src/store/mod.rs b/matrix_sdk_crypto/src/store/mod.rs index 0bea21fc..4a9a4044 100644 --- a/matrix_sdk_crypto/src/store/mod.rs +++ b/matrix_sdk_crypto/src/store/mod.rs @@ -12,15 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::{collections::HashSet, io::Error as IoError, sync::Arc}; +use std::{collections::HashSet, fmt::Debug, io::Error as IoError, sync::Arc}; -use async_trait::async_trait; -use core::fmt::Debug; use matrix_sdk_common::{ identifiers::{DeviceId, RoomId, UserId}, locks::Mutex, }; +use matrix_sdk_common_macros::async_trait; +#[cfg(not(target_arch = "wasm32"))] use matrix_sdk_common_macros::send_sync; + use olm_rs::errors::{OlmAccountError, OlmGroupSessionError, OlmSessionError}; use serde_json::Error as SerdeError; use thiserror::Error; @@ -89,11 +90,11 @@ pub enum CryptoStoreError { pub type Result = std::result::Result; +/// Trait abstracting a store that the `OlmMachine` uses to store cryptographic +/// keys. #[async_trait] #[allow(clippy::type_complexity)] #[cfg_attr(not(target_arch = "wasm32"), send_sync)] -/// Trait abstracting a store that the `OlmMachine` uses to store cryptographic -/// keys. pub trait CryptoStore: Debug { /// Load an account that was previously stored. async fn load_account(&self) -> Result>;