improve code w/ clippy
This commit is contained in:
parent
3e2e058bcc
commit
a4b8bf1e3f
@ -50,9 +50,9 @@ async fn update(
|
||||
) -> Flash<Redirect> {
|
||||
let d = data.into_inner();
|
||||
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 {
|
||||
return Flash::error(Redirect::to("/admin/mail"), "Fehler");
|
||||
Flash::error(Redirect::to("/admin/mail"), "Fehler")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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"),
|
||||
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)."),
|
||||
|
@ -36,10 +36,7 @@ async fn index(
|
||||
if let Some(msg) = flash {
|
||||
context.insert("flash", &msg.into_inner());
|
||||
}
|
||||
context.insert(
|
||||
"loggedin_user",
|
||||
&UserWithRoles::from_user(user.into(), db).await,
|
||||
);
|
||||
context.insert("loggedin_user", &UserWithRoles::from_user(user, db).await);
|
||||
context.insert("days", &days);
|
||||
Template::render("planned", context.into_json())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user