From e109e01a28ca8c312ae8d5612306ffdd79ff0a29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Thu, 30 Apr 2020 14:29:58 +0200 Subject: [PATCH] crypto: More lint fixes. --- matrix_sdk_crypto/src/lib.rs | 4 ++++ matrix_sdk_crypto/src/machine.rs | 8 ++++---- matrix_sdk_crypto/src/memory_stores.rs | 6 +++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/matrix_sdk_crypto/src/lib.rs b/matrix_sdk_crypto/src/lib.rs index 325be87b..1d4065f7 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 5bc1817d..038e1286 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 000087c9..af880754 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>>, }