Fix some clippy issues

This commit is contained in:
Tobias Reisinger 2024-04-25 01:41:53 +02:00
parent 8a83602d6a
commit b2e9c6b27a
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
4 changed files with 4 additions and 13 deletions

View file

@ -43,7 +43,7 @@ async fn main() -> Result<(), std::io::Error> {
}); });
let app_state_pool = pool.clone(); let app_state_pool = pool.clone();
let app_state = Actor::start_in_arbiter(&app_state_arbiter.handle(), move |_| { 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!( log::info!(

View file

@ -170,7 +170,7 @@ impl DbRelay {
conn: &mut PoolConnection<Sqlite>, conn: &mut PoolConnection<Sqlite>,
) -> Result<DbSchedule, DatabaseError> { ) -> Result<DbSchedule, DatabaseError> {
let weekday = utils::get_weekday(); let weekday = utils::get_weekday();
DbJunctionRelaySchedule::get_schedule(conn, &self, weekday as Weekday) DbJunctionRelaySchedule::get_schedule(conn, self, weekday as Weekday)
.await? .await?
.ok_or(DatabaseError::NotFound) .ok_or(DatabaseError::NotFound)
} }

View file

@ -17,7 +17,7 @@ impl DbTag {
conn: &mut PoolConnection<Sqlite>, conn: &mut PoolConnection<Sqlite>,
new_tag: &str, new_tag: &str,
) -> Result<DbTag, DatabaseError> { ) -> Result<DbTag, DatabaseError> {
if new_tag.len() == 0 { if new_tag.is_empty() {
return Err(DatabaseError::EmptyDataInsert); return Err(DatabaseError::EmptyDataInsert);
} }

View file

@ -19,7 +19,7 @@ pub struct Logging {
pub file: String, pub file: String,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Clone, Debug, Deserialize, Default)]
#[serde(default)] #[serde(default)]
#[allow(unused)] #[allow(unused)]
pub struct Permissions { 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<T>(config_name: &str, env_prefix: &str) -> Result<T, EmgauwaError> pub fn load<T>(config_name: &str, env_prefix: &str) -> Result<T, EmgauwaError>
where where
for<'de> T: serde::Deserialize<'de>, for<'de> T: serde::Deserialize<'de>,