Merge pull request #112 from polyphony-chat/refactor/clippy-lints

apply clippy suggestions
This commit is contained in:
Flori 2023-06-19 19:07:18 +02:00 committed by GitHub
commit 29c7f16267
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 8 deletions

View File

@ -48,7 +48,7 @@ impl Channel {
.delete(format!( .delete(format!(
"{}/channels/{}/", "{}/channels/{}/",
user.belongs_to.borrow_mut().urls.get_api(), user.belongs_to.borrow_mut().urls.get_api(),
self.id.to_string() self.id
)) ))
.bearer_auth(user.token()); .bearer_auth(user.token());
let response = let response =

View File

@ -48,7 +48,7 @@ pub async fn deserialize_response<T: for<'a> Deserialize<'a>>(
return Err(ChorusLibError::InvalidResponseError { return Err(ChorusLibError::InvalidResponseError {
error: format!( error: format!(
"Error while trying to process the HTTP response into a String: {}", "Error while trying to process the HTTP response into a String: {}",
e.to_string() e
), ),
}); });
} }
@ -59,7 +59,7 @@ pub async fn deserialize_response<T: for<'a> Deserialize<'a>>(
return Err(ChorusLibError::InvalidResponseError { return Err(ChorusLibError::InvalidResponseError {
error: format!( error: format!(
"Error while trying to deserialize the JSON response into T: {}", "Error while trying to deserialize the JSON response into T: {}",
e.to_string() e
), ),
}) })
} }

View File

@ -120,7 +120,7 @@ impl Guild {
.get(format!( .get(format!(
"{}/guilds/{}/channels/", "{}/guilds/{}/channels/",
user.belongs_to.borrow().urls.get_api(), user.belongs_to.borrow().urls.get_api(),
self.id.to_string() self.id
)) ))
.bearer_auth(user.token()); .bearer_auth(user.token());
let result = handle_request(request, user, crate::api::limits::LimitType::Channel) let result = handle_request(request, user, crate::api::limits::LimitType::Channel)

View File

@ -417,11 +417,9 @@ impl Gateway {
if msg.is_error() { if msg.is_error() {
println!("GW: Received error, connection will close.."); println!("GW: Received error, connection will close..");
let error = msg.error(); let _error = msg.error();
match error { {}
_ => {}
}
self.close().await; self.close().await;
return; return;

View File

@ -93,6 +93,7 @@ pub async fn setup() -> TestBundle {
} }
// Teardown method to clean up after a test. // Teardown method to clean up after a test.
#[allow(dead_code)]
pub async fn teardown(mut bundle: TestBundle) { pub async fn teardown(mut bundle: TestBundle) {
Guild::delete(&mut bundle.user, &bundle.guild.id.to_string()).await; Guild::delete(&mut bundle.user, &bundle.guild.id.to_string()).await;
bundle.user.delete().await; bundle.user.delete().await;