diff --git a/matrix_sdk_base/src/client.rs b/matrix_sdk_base/src/client.rs index 46c28d5d..5cbc2b04 100644 --- a/matrix_sdk_base/src/client.rs +++ b/matrix_sdk_base/src/client.rs @@ -61,6 +61,7 @@ use matrix_sdk_crypto::{OlmMachine, OneTimeKeys}; pub type Token = String; /// Signals to the `BaseClient` which `RoomState` to send to `EventEmitter`. +#[derive(Debug)] pub enum RoomStateType { /// Represents a joined room, the `joined_rooms` HashMap will be used. Joined, @@ -75,6 +76,7 @@ pub enum RoomStateType { /// If the event came from the `join`, `invite` or `leave` rooms map from the server /// the variant that holds the corresponding room is used. `RoomState` is generic /// so it can be used to represent a `Room` or an `Arc>` +#[derive(Debug)] pub enum RoomState { /// A room from the `join` section of a sync response. Joined(R), diff --git a/matrix_sdk_base/src/lib.rs b/matrix_sdk_base/src/lib.rs index 9c61b2c1..da31f38a 100644 --- a/matrix_sdk_base/src/lib.rs +++ b/matrix_sdk_base/src/lib.rs @@ -24,7 +24,16 @@ //! keys. If this is disabled and `encryption` support is enabled the keys will //! by default be stored only in memory and thus lost after the client is //! destroyed. -#![deny(missing_docs)] +#![deny( + missing_debug_implementations, + dead_code, + missing_docs, + trivial_casts, + trivial_numeric_casts, + unused_extern_crates, + unused_import_braces, + unused_qualifications +)] pub use crate::{error::Error, error::Result, session::Session}; pub use matrix_sdk_common::*; diff --git a/matrix_sdk_base/src/state/json_store.rs b/matrix_sdk_base/src/state/json_store.rs index 4d519617..8c74532b 100644 --- a/matrix_sdk_base/src/state/json_store.rs +++ b/matrix_sdk_base/src/state/json_store.rs @@ -1,4 +1,5 @@ use std::collections::HashMap; +use std::fmt; use std::fs; use std::path::{Path, PathBuf}; use std::sync::{ @@ -39,6 +40,14 @@ impl JsonStore { } } +impl fmt::Debug for JsonStore { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("JsonStore") + .field("path", &self.path) + .finish() + } +} + #[async_trait::async_trait] impl StateStore for JsonStore { async fn load_client_state(&self, sess: &Session) -> Result> { diff --git a/matrix_sdk_base/src/state/mod.rs b/matrix_sdk_base/src/state/mod.rs index cc785de4..6d628e2d 100644 --- a/matrix_sdk_base/src/state/mod.rs +++ b/matrix_sdk_base/src/state/mod.rs @@ -68,6 +68,7 @@ impl ClientState { /// `JsonStore::load_all_rooms` returns `AllRooms`. /// /// `AllRooms` is made of the `joined`, `invited` and `left` room maps. +#[derive(Debug)] pub struct AllRooms { /// The joined room mapping of `RoomId` to `Room`. pub joined: HashMap,