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 std::{collections::HashSet, sync::Arc};
use async_trait::async_trait;
use dashmap::{DashMap, DashSet}; use dashmap::{DashMap, DashSet};
use matrix_sdk_common::{ use matrix_sdk_common::{
identifiers::{DeviceId, RoomId, UserId}, identifiers::{DeviceId, RoomId, UserId},
locks::Mutex, locks::Mutex,
}; };
use matrix_sdk_common_macros::async_trait;
use super::{Account, CryptoStore, InboundGroupSession, Result, Session}; use super::{Account, CryptoStore, InboundGroupSession, Result, Session};
use crate::{ use crate::{

View File

@ -12,15 +12,16 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // 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::{ use matrix_sdk_common::{
identifiers::{DeviceId, RoomId, UserId}, identifiers::{DeviceId, RoomId, UserId},
locks::Mutex, locks::Mutex,
}; };
use matrix_sdk_common_macros::async_trait;
#[cfg(not(target_arch = "wasm32"))]
use matrix_sdk_common_macros::send_sync; use matrix_sdk_common_macros::send_sync;
use olm_rs::errors::{OlmAccountError, OlmGroupSessionError, OlmSessionError}; use olm_rs::errors::{OlmAccountError, OlmGroupSessionError, OlmSessionError};
use serde_json::Error as SerdeError; use serde_json::Error as SerdeError;
use thiserror::Error; use thiserror::Error;
@ -89,11 +90,11 @@ pub enum CryptoStoreError {
pub type Result<T> = std::result::Result<T, CryptoStoreError>; pub type Result<T> = std::result::Result<T, CryptoStoreError>;
/// Trait abstracting a store that the `OlmMachine` uses to store cryptographic
/// keys.
#[async_trait] #[async_trait]
#[allow(clippy::type_complexity)] #[allow(clippy::type_complexity)]
#[cfg_attr(not(target_arch = "wasm32"), send_sync)] #[cfg_attr(not(target_arch = "wasm32"), send_sync)]
/// Trait abstracting a store that the `OlmMachine` uses to store cryptographic
/// keys.
pub trait CryptoStore: Debug { pub trait CryptoStore: Debug {
/// Load an account that was previously stored. /// Load an account that was previously stored.
async fn load_account(&self) -> Result<Option<Account>>; async fn load_account(&self) -> Result<Option<Account>>;