clean w/ clippy
This commit is contained in:
@ -26,7 +26,7 @@ async fn index(
|
||||
}
|
||||
context.insert(
|
||||
"loggedin_user",
|
||||
&UserWithRoles::from_user(user.user.into(), db).await,
|
||||
&UserWithRoles::from_user(user.user, db).await,
|
||||
);
|
||||
context.insert("roles", &Role::all(db).await);
|
||||
|
||||
@ -57,7 +57,7 @@ async fn send(
|
||||
return Flash::error(Redirect::to("/admin/notification"), "Rolle gibt's ned");
|
||||
};
|
||||
|
||||
for user in User::all_with_role(&db, &role).await {
|
||||
for user in User::all_with_role(db, &role).await {
|
||||
Notification::create(db, &user, &d.message, &d.category, None).await;
|
||||
}
|
||||
Log::create(db, "Notification successfully sent".into()).await;
|
||||
|
@ -27,10 +27,8 @@ async fn index(
|
||||
let boats = Boat::all_for_boatshouse(db).await;
|
||||
let mut final_boats = Vec::new();
|
||||
for boat in boats {
|
||||
if boat.boat.boathouse(db).await.is_none() {
|
||||
if boat.boat.name != "Externes Boot" {
|
||||
final_boats.push(boat);
|
||||
}
|
||||
if boat.boat.boathouse(db).await.is_none() && boat.boat.name != "Externes Boot" {
|
||||
final_boats.push(boat);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -161,7 +161,7 @@ async fn delete<'r>(
|
||||
} else {
|
||||
Flash::error(
|
||||
Redirect::to("/boatreservation"),
|
||||
format!("Nur der Reservierer darf die Reservierung löschen."),
|
||||
"Nur der Reservierer darf die Reservierung löschen.".to_string(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -66,8 +66,8 @@ async fn steering(db: &State<SqlitePool>, user: User, flash: Option<FlashMessage
|
||||
|
||||
let mut coxes = User::all_with_role(db, &Role::find_by_name(db, "cox").await.unwrap()).await;
|
||||
|
||||
coxes.retain(|user| !bootskundige.contains(&user)); // Remove bootskundige from coxes list
|
||||
coxes.retain(|user| user.name != String::from("Externe Steuerperson"));
|
||||
coxes.retain(|user| !bootskundige.contains(user)); // Remove bootskundige from coxes list
|
||||
coxes.retain(|user| user.name != "Externe Steuerperson");
|
||||
|
||||
context.insert("coxes", &coxes);
|
||||
context.insert("bootskundige", &bootskundige);
|
||||
|
Reference in New Issue
Block a user