crypto: Use the correct async-trait macro for the CryptoStores.

master
Damir Jelić 2020-09-01 17:41:30 +02:00
parent 0de4a21320
commit 987d87cd5d
2 changed files with 7 additions and 6 deletions

View File

@ -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::{

View File

@ -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<T> = std::result::Result<T, CryptoStoreError>;
/// 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<Option<Account>>;