clean code with clippy

This commit is contained in:
2023-05-30 14:36:23 +02:00
parent 7fcae95b02
commit 9c30cda326
5 changed files with 8 additions and 17 deletions

View File

@ -33,17 +33,8 @@ impl Day {
pub async fn new_guest(db: &SqlitePool, day: NaiveDate) -> Self {
let mut day = Self::new(db, day).await;
day.planned_events = day
.planned_events
.into_iter()
.filter(|e| e.planned_event.allow_guests)
.collect();
day.trips = day
.trips
.into_iter()
.filter(|t| t.trip.allow_guests)
.collect();
day.planned_events.retain(|e| e.planned_event.allow_guests);
day.trips.retain(|t| t.trip.allow_guests);
day
}