From 4fb2cc10383d643d2eae7de033476dcd0f4c0b0b Mon Sep 17 00:00:00 2001 From: Patryk Hegenberg Date: Wed, 1 May 2024 22:56:44 +0200 Subject: [PATCH] fix(sender): performed code cleanup with clippy --- src/sender/client.rs | 7 ------- src/sender/http_client.rs | 3 +-- src/sender/util.rs | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/sender/client.rs b/src/sender/client.rs index a03ec4f..02f0ad6 100644 --- a/src/sender/client.rs +++ b/src/sender/client.rs @@ -110,13 +110,6 @@ struct Context { task: Option>, } -impl Context { - async fn clean_up(&mut self) { - if let Some(task) = &self.task { - task.abort(); - } - } -} /// This function is called when the client receives a create room packet /// from the server. The function is responsible for printing a URL to the /// console that the user can use to join the room. diff --git a/src/sender/http_client.rs b/src/sender/http_client.rs index 20151db..366e038 100644 --- a/src/sender/http_client.rs +++ b/src/sender/http_client.rs @@ -1,4 +1,3 @@ -use std::collections::HashMap; use tracing::{debug, error}; use local_ip_address::{local_ip, local_ipv6}; @@ -55,5 +54,5 @@ pub async fn send_info( }) .await?; - Ok(result?) + result } diff --git a/src/sender/util.rs b/src/sender/util.rs index 14f3fa0..d429a24 100644 --- a/src/sender/util.rs +++ b/src/sender/util.rs @@ -29,7 +29,7 @@ fn nouns2() -> &'static [&'static str] { pub fn hash_random_name(name: String) -> String { let hashed_name = Sha256::digest(name.as_bytes()); - return hex::encode(hashed_name); + hex::encode(hashed_name) } #[cfg(test)]