clean w/ clippy
This commit is contained in:
@ -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();
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
|
Reference in New Issue
Block a user