clean w/ clippy
All checks were successful
CI/CD Pipeline / test (push) Successful in 12m52s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped

This commit is contained in:
2024-04-15 23:26:52 +02:00
parent 151e1b7864
commit 2694829b6e
7 changed files with 13 additions and 16 deletions

View File

@ -507,7 +507,7 @@ ORDER BY departure DESC
let dep = NaiveDateTime::parse_from_str(&log.departure, "%Y-%m-%dT%H:%M").unwrap();
let arr = NaiveDateTime::parse_from_str(&log.arrival, "%Y-%m-%dT%H:%M").unwrap();
if arr.timestamp() < dep.timestamp() {
if arr.and_utc().timestamp() < dep.and_utc().timestamp() {
return Err(LogbookUpdateError::ArrivalNotAfterDeparture);
}
let today = Local::now().date_naive();

View File

@ -78,7 +78,7 @@ impl Trip {
"{} hat eine Ausfahrt zur selben Zeit ({} um {}) wie du erstellt",
cox.user.name, trip.day, trip.planned_starting_time
),
"Neue Ausfahrt zur selben Zeit".into(),
"Neue Ausfahrt zur selben Zeit",
None,
)
.await;

View File

@ -27,8 +27,7 @@ impl UserTrip {
//TODO: Check if user sees the event (otherwise she could forge trip_details_id)
let is_cox = trip_details.user_is_cox(db, user).await;
let mut name_newly_registered_person = String::new();
if user_note.is_none() {
let name_newly_registered_person = if user_note.is_none() {
if let Yes(action) = is_cox {
match action {
Action::Helping => return Err(UserTripError::AlreadyRegisteredAsCox),
@ -49,7 +48,7 @@ impl UserTrip {
.await
.unwrap();
name_newly_registered_person = user.name.clone();
user.name.clone()
} else {
if !trip_details.user_allowed_to_change(db, user).await {
return Err(UserTripError::NotAllowedToAddGuest);
@ -63,8 +62,8 @@ impl UserTrip {
.await
.unwrap();
name_newly_registered_person = user_note.unwrap();
}
user_note.unwrap()
};
if let Some(trip) = Trip::find_by_trip_details(db, trip_details.id).await {
let cox = User::find_by_id(db, trip.cox_id as i32).await.unwrap();