improve code w/ clippy
All checks were successful
CI/CD Pipeline / test (push) Successful in 15m22s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped

This commit is contained in:
philipp 2024-01-10 14:24:58 +01:00
parent 3e2e058bcc
commit a4b8bf1e3f
3 changed files with 4 additions and 7 deletions

View File

@ -50,9 +50,9 @@ async fn update(
) -> Flash<Redirect> { ) -> Flash<Redirect> {
let d = data.into_inner(); let d = data.into_inner();
if Mail::send(db, d, config.smtp_pw.clone()).await { if Mail::send(db, d, config.smtp_pw.clone()).await {
return Flash::success(Redirect::to("/admin/mail"), "Mail versendet"); Flash::success(Redirect::to("/admin/mail"), "Mail versendet")
} else { } else {
return Flash::error(Redirect::to("/admin/mail"), "Fehler"); Flash::error(Redirect::to("/admin/mail"), "Fehler")
} }
} }

View File

@ -252,7 +252,7 @@ async fn home_logbook(
); );
}; };
match logbook.home(db, &user, data.into_inner()).await { match logbook.home(db,user, data.into_inner()).await {
Ok(_) => Flash::success(Redirect::to("/log"), "Ausfahrt korrekt eingetragen"), Ok(_) => Flash::success(Redirect::to("/log"), "Ausfahrt korrekt eingetragen"),
Err(LogbookUpdateError::TooManyRowers(expected, actual)) => Flash::error(Redirect::to("/log"), format!("Zu viele Ruderer (Boot fasst maximal {expected}, es wurden jedoch {actual} Ruderer ausgewählt)")), Err(LogbookUpdateError::TooManyRowers(expected, actual)) => Flash::error(Redirect::to("/log"), format!("Zu viele Ruderer (Boot fasst maximal {expected}, es wurden jedoch {actual} Ruderer ausgewählt)")),
Err(LogbookUpdateError::OnlyAllowedToEndTripsEndingToday) => Flash::error(Redirect::to("/log"), "Nur Ausfahrten, die heute enden dürfen eingetragen werden. Für einen Nachtrag schreibe alle Daten Philipp (Tel. nr. siehe Signal oder it@rudernlinz.at)."), Err(LogbookUpdateError::OnlyAllowedToEndTripsEndingToday) => Flash::error(Redirect::to("/log"), "Nur Ausfahrten, die heute enden dürfen eingetragen werden. Für einen Nachtrag schreibe alle Daten Philipp (Tel. nr. siehe Signal oder it@rudernlinz.at)."),

View File

@ -36,10 +36,7 @@ async fn index(
if let Some(msg) = flash { if let Some(msg) = flash {
context.insert("flash", &msg.into_inner()); context.insert("flash", &msg.into_inner());
} }
context.insert( context.insert("loggedin_user", &UserWithRoles::from_user(user, db).await);
"loggedin_user",
&UserWithRoles::from_user(user.into(), db).await,
);
context.insert("days", &days); context.insert("days", &days);
Template::render("planned", context.into_json()) Template::render("planned", context.into_json())
} }