From ec3a531f48deb7afe9bf09884aebe6e919c73811 Mon Sep 17 00:00:00 2001 From: Flori Weber Date: Mon, 19 Jun 2023 19:01:18 +0200 Subject: [PATCH] apply clippy suggestions --- src/api/channels/channels.rs | 2 +- src/api/common.rs | 4 ++-- src/api/guilds/guilds.rs | 2 +- src/gateway.rs | 6 ++---- tests/common/mod.rs | 1 + 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/api/channels/channels.rs b/src/api/channels/channels.rs index 7c4c8aa..8c96472 100644 --- a/src/api/channels/channels.rs +++ b/src/api/channels/channels.rs @@ -48,7 +48,7 @@ impl Channel { .delete(format!( "{}/channels/{}/", user.belongs_to.borrow_mut().urls.get_api(), - self.id.to_string() + self.id )) .bearer_auth(user.token()); let response = diff --git a/src/api/common.rs b/src/api/common.rs index cecec5a..af9d975 100644 --- a/src/api/common.rs +++ b/src/api/common.rs @@ -48,7 +48,7 @@ pub async fn deserialize_response Deserialize<'a>>( return Err(ChorusLibError::InvalidResponseError { error: format!( "Error while trying to process the HTTP response into a String: {}", - e.to_string() + e ), }); } @@ -59,7 +59,7 @@ pub async fn deserialize_response Deserialize<'a>>( return Err(ChorusLibError::InvalidResponseError { error: format!( "Error while trying to deserialize the JSON response into T: {}", - e.to_string() + e ), }) } diff --git a/src/api/guilds/guilds.rs b/src/api/guilds/guilds.rs index 6fea804..95c3bc2 100644 --- a/src/api/guilds/guilds.rs +++ b/src/api/guilds/guilds.rs @@ -120,7 +120,7 @@ impl Guild { .get(format!( "{}/guilds/{}/channels/", user.belongs_to.borrow().urls.get_api(), - self.id.to_string() + self.id )) .bearer_auth(user.token()); let result = handle_request(request, user, crate::api::limits::LimitType::Channel) diff --git a/src/gateway.rs b/src/gateway.rs index 28ed702..5cececa 100644 --- a/src/gateway.rs +++ b/src/gateway.rs @@ -417,11 +417,9 @@ impl Gateway { if msg.is_error() { println!("GW: Received error, connection will close.."); - let error = msg.error(); + let _error = msg.error(); - match error { - _ => {} - } + {} self.close().await; return; diff --git a/tests/common/mod.rs b/tests/common/mod.rs index 5a29a0b..224014a 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -93,6 +93,7 @@ pub async fn setup() -> TestBundle { } // Teardown method to clean up after a test. +#[allow(dead_code)] pub async fn teardown(mut bundle: TestBundle) { Guild::delete(&mut bundle.user, &bundle.guild.id.to_string()).await; bundle.user.delete().await;