From b2e9c6b27a2c018c466af5cf41d336166a3cd994 Mon Sep 17 00:00:00 2001 From: Tobias Reisinger Date: Thu, 25 Apr 2024 01:41:53 +0200 Subject: [PATCH] Fix some clippy issues --- emgauwa-core/src/main.rs | 2 +- emgauwa-lib/src/db/relays.rs | 2 +- emgauwa-lib/src/db/tag.rs | 2 +- emgauwa-lib/src/settings.rs | 11 +---------- 4 files changed, 4 insertions(+), 13 deletions(-) diff --git a/emgauwa-core/src/main.rs b/emgauwa-core/src/main.rs index 6bd47a3..d1b0d31 100644 --- a/emgauwa-core/src/main.rs +++ b/emgauwa-core/src/main.rs @@ -43,7 +43,7 @@ async fn main() -> Result<(), std::io::Error> { }); let app_state_pool = pool.clone(); let app_state = Actor::start_in_arbiter(&app_state_arbiter.handle(), move |_| { - AppState::new(app_state_pool.clone()) + AppState::new(app_state_pool) }); log::info!( diff --git a/emgauwa-lib/src/db/relays.rs b/emgauwa-lib/src/db/relays.rs index 91d3759..2ac448a 100644 --- a/emgauwa-lib/src/db/relays.rs +++ b/emgauwa-lib/src/db/relays.rs @@ -170,7 +170,7 @@ impl DbRelay { conn: &mut PoolConnection, ) -> Result { let weekday = utils::get_weekday(); - DbJunctionRelaySchedule::get_schedule(conn, &self, weekday as Weekday) + DbJunctionRelaySchedule::get_schedule(conn, self, weekday as Weekday) .await? .ok_or(DatabaseError::NotFound) } diff --git a/emgauwa-lib/src/db/tag.rs b/emgauwa-lib/src/db/tag.rs index 25028e1..9c15f79 100644 --- a/emgauwa-lib/src/db/tag.rs +++ b/emgauwa-lib/src/db/tag.rs @@ -17,7 +17,7 @@ impl DbTag { conn: &mut PoolConnection, new_tag: &str, ) -> Result { - if new_tag.len() == 0 { + if new_tag.is_empty() { return Err(DatabaseError::EmptyDataInsert); } diff --git a/emgauwa-lib/src/settings.rs b/emgauwa-lib/src/settings.rs index 4d56f6f..94d1343 100644 --- a/emgauwa-lib/src/settings.rs +++ b/emgauwa-lib/src/settings.rs @@ -19,7 +19,7 @@ pub struct Logging { pub file: String, } -#[derive(Clone, Debug, Deserialize)] +#[derive(Clone, Debug, Deserialize, Default)] #[serde(default)] #[allow(unused)] pub struct Permissions { @@ -45,15 +45,6 @@ impl Default for Logging { } } -impl Default for Permissions { - fn default() -> Self { - Permissions { - user: String::from(""), - group: String::from(""), - } - } -} - pub fn load(config_name: &str, env_prefix: &str) -> Result where for<'de> T: serde::Deserialize<'de>,