more clippy :-)
This commit is contained in:
@ -31,19 +31,20 @@ pub struct Day {
|
||||
|
||||
impl Day {
|
||||
pub async fn new(db: &SqlitePool, day: NaiveDate, is_pinned: bool) -> Self {
|
||||
let planned_events = match is_pinned {
|
||||
true => PlannedEvent::get_pinned_for_day(db, day).await,
|
||||
false => PlannedEvent::get_for_day(db, day).await,
|
||||
};
|
||||
let trips = match is_pinned {
|
||||
true => Trip::get_pinned_for_day(db, day).await,
|
||||
false => Trip::get_for_day(db, day).await,
|
||||
};
|
||||
Self {
|
||||
day,
|
||||
planned_events,
|
||||
trips,
|
||||
is_pinned,
|
||||
if is_pinned {
|
||||
Self {
|
||||
day,
|
||||
planned_events: PlannedEvent::get_pinned_for_day(db, day).await,
|
||||
trips: Trip::get_pinned_for_day(db, day).await,
|
||||
is_pinned,
|
||||
}
|
||||
} else {
|
||||
Self {
|
||||
day,
|
||||
planned_events: PlannedEvent::get_for_day(db, day).await,
|
||||
trips: Trip::get_for_day(db, day).await,
|
||||
is_pinned,
|
||||
}
|
||||
}
|
||||
}
|
||||
pub async fn new_guest(db: &SqlitePool, day: NaiveDate, is_pinned: bool) -> Self {
|
||||
|
Reference in New Issue
Block a user