From 5b1188a38b1a778996db099cbcce537e8ee9919f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Wed, 13 May 2020 12:47:24 +0200 Subject: [PATCH] matrix-sdk: Add more strict lints. --- matrix_sdk/src/client.rs | 6 +++--- matrix_sdk/src/lib.rs | 12 +++++++++++- matrix_sdk/src/request_builder.rs | 4 ++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/matrix_sdk/src/client.rs b/matrix_sdk/src/client.rs index e7b3c654..da3c741c 100644 --- a/matrix_sdk/src/client.rs +++ b/matrix_sdk/src/client.rs @@ -1268,7 +1268,7 @@ mod test { #[tokio::test] async fn room_creation() { - let session = crate::Session { + let session = Session { access_token: "12345".to_owned(), user_id: UserId::try_from("@example:localhost").unwrap(), device_id: "DEVICEID".to_owned(), @@ -1790,7 +1790,7 @@ mod test { async fn invited_rooms() { use std::convert::TryFrom; - let session = crate::Session { + let session = Session { access_token: "12345".to_owned(), user_id: UserId::try_from("@example:localhost").unwrap(), device_id: "DEVICEID".to_owned(), @@ -1823,7 +1823,7 @@ mod test { async fn left_rooms() { use std::convert::TryFrom; - let session = crate::Session { + let session = Session { access_token: "12345".to_owned(), user_id: UserId::try_from("@example:localhost").unwrap(), device_id: "DEVICEID".to_owned(), diff --git a/matrix_sdk/src/lib.rs b/matrix_sdk/src/lib.rs index e39ae724..d8246fe5 100644 --- a/matrix_sdk/src/lib.rs +++ b/matrix_sdk/src/lib.rs @@ -24,7 +24,17 @@ //! 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 +)] #[cfg(not(target_arch = "wasm32"))] pub use matrix_sdk_base::JsonStore; diff --git a/matrix_sdk/src/request_builder.rs b/matrix_sdk/src/request_builder.rs index de14c2ca..b75a2cba 100644 --- a/matrix_sdk/src/request_builder.rs +++ b/matrix_sdk/src/request_builder.rs @@ -34,7 +34,7 @@ use crate::js_int::UInt; /// cli.create_room(builder).await; /// # }) /// ``` -#[derive(Clone, Default)] +#[derive(Clone, Debug, Default)] pub struct RoomBuilder { /// Extra keys to be added to the content of the `m.room.create`. creation_content: Option, @@ -198,7 +198,7 @@ impl Into for RoomBuilder { /// cli.room_messages(builder).await.is_err(); /// # }) /// ``` -#[derive(Clone, Default)] +#[derive(Clone, Debug, Default)] pub struct MessagesRequestBuilder { /// The room to get events from. room_id: Option,