diff --git a/matrix_sdk_crypto/src/lib.rs b/matrix_sdk_crypto/src/lib.rs index 325be87b9..1d4065f74 100644 --- a/matrix_sdk_crypto/src/lib.rs +++ b/matrix_sdk_crypto/src/lib.rs @@ -25,4 +25,8 @@ mod store; pub use device::{Device, TrustState}; pub use error::{MegolmError, OlmError}; pub use machine::{OlmMachine, OneTimeKeys}; +pub use memory_stores::{DeviceStore, GroupSessionStore, SessionStore, UserDevices}; +pub use olm::{Account, InboundGroupSession, OutboundGroupSession, Session}; +#[cfg(feature = "sqlite-cryptostore")] +pub use store::sqlite::SqliteStore; pub use store::{CryptoStore, CryptoStoreError}; diff --git a/matrix_sdk_crypto/src/machine.rs b/matrix_sdk_crypto/src/machine.rs index 5bc1817db..038e12862 100644 --- a/matrix_sdk_crypto/src/machine.rs +++ b/matrix_sdk_crypto/src/machine.rs @@ -30,8 +30,8 @@ use super::olm::{ }; use super::store::memorystore::MemoryStore; #[cfg(feature = "sqlite-cryptostore")] -use super::store::sqlite::SqliteStore; -use super::{device::Device, store::Result as StoreError, CryptoStore}; +use super::store::{sqlite::SqliteStore, Result as StoreError}; +use super::{device::Device, CryptoStore}; use matrix_sdk_types::api; use matrix_sdk_types::events::{ @@ -1467,10 +1467,10 @@ mod test { to_device_request .messages .values() - .nth(0) + .next() .unwrap() .values() - .nth(0) + .next() .unwrap() .json() .get(), diff --git a/matrix_sdk_crypto/src/memory_stores.rs b/matrix_sdk_crypto/src/memory_stores.rs index 000087c90..af880754d 100644 --- a/matrix_sdk_crypto/src/memory_stores.rs +++ b/matrix_sdk_crypto/src/memory_stores.rs @@ -23,7 +23,7 @@ use super::olm::{InboundGroupSession, Session}; use matrix_sdk_types::identifiers::{DeviceId, RoomId, UserId}; /// In-memory store for Olm Sessions. -#[derive(Debug)] +#[derive(Debug, Default)] pub struct SessionStore { entries: HashMap>>>, } @@ -69,7 +69,7 @@ impl SessionStore { } } -#[derive(Debug)] +#[derive(Debug, Default)] /// In-memory store that houlds inbound group sessions. pub struct GroupSessionStore { entries: HashMap>>, @@ -127,7 +127,7 @@ impl GroupSessionStore { } /// In-memory store holding the devices of users. -#[derive(Clone, Debug)] +#[derive(Clone, Debug, Default)] pub struct DeviceStore { entries: Arc>>, }