diff --git a/src/async_client.rs b/src/async_client.rs index 2a5ff067..14e1916b 100644 --- a/src/async_client.rs +++ b/src/async_client.rs @@ -193,7 +193,7 @@ impl AsyncClient { ) -> Result { let homeserver: Url = match homeserver_url.try_into() { Ok(u) => u, - Err(e) => panic!("Error parsing homeserver url"), + Err(_e) => panic!("Error parsing homeserver url"), }; let http_client = reqwest::Client::builder(); diff --git a/src/base_client.rs b/src/base_client.rs index 37b56d0d..2d5e50ab 100644 --- a/src/base_client.rs +++ b/src/base_client.rs @@ -47,10 +47,10 @@ impl Room { /// /// * `room_id` - The unique id of the room. /// * `own_user_id` - The mxid of our own user. - pub fn new(room_id: &str, own_user_id: &UserId) -> Self { + pub fn new(room_id: &str, own_user_id: &str) -> Self { Room { room_id: room_id.to_string(), - own_user_id: own_user_id.clone(), + own_user_id: own_user_id.to_owned(), creator: None, members: HashMap::new(), typing_users: Vec::new(), @@ -196,7 +196,8 @@ impl Client { self.session = Some(session); } - fn get_or_create_room(&mut self, room_id: &RoomId) -> &mut Arc> { + fn get_or_create_room(&mut self, room_id: &str) -> &mut Arc> { + #[allow(clippy::or_fun_call)] self.joined_rooms .entry(room_id.to_string()) .or_insert(Arc::new(RwLock::new(Room::new( @@ -221,7 +222,7 @@ impl Client { /// otherwise. pub fn receive_joined_timeline_event( &mut self, - room_id: &RoomId, + room_id: &str, event: &EventResult, ) -> bool { match event { diff --git a/src/error.rs b/src/error.rs index c97e1c6d..36088ab6 100644 --- a/src/error.rs +++ b/src/error.rs @@ -18,7 +18,6 @@ impl Display for Error { let message = match self.0 { InnerError::AuthenticationRequired => "The queried endpoint requires authentication but was called with an anonymous client.", InnerError::Reqwest(_) => "An HTTP error occurred.", - InnerError::ConfigurationError(_) => "Error configuring the client", InnerError::Uri(_) => "Provided string could not be converted into a URI.", InnerError::RumaApi(_) => "An error occurred converting between ruma_client_api and hyper types.", InnerError::SerdeJson(_) => "A serialization error occurred.", @@ -36,8 +35,6 @@ impl StdError for Error {} pub(crate) enum InnerError { /// Queried endpoint requires authentication but was called on an anonymous client. AuthenticationRequired, - /// An error in the client configuration. - ConfigurationError(String), /// An error at the HTTP layer. Reqwest(ReqwestError), /// An error when parsing a string as a URI. diff --git a/src/lib.rs b/src/lib.rs index c4a51178..a724ac03 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,5 @@ -//! Crate `nio-client` is a [Matrix](https://matrix.org/) client library. -//! -#![warn(missing_docs)] +//! This crate implements a [Matrix](https://matrix.org/) client library. +#![deny(missing_docs)] pub use crate::{error::Error, session::Session}; pub use reqwest::header::InvalidHeaderValue;