clippy :-)
All checks were successful
CI/CD Pipeline / test (push) Successful in 8m57s
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-30 21:35:14 +02:00
parent 3323807e46
commit 17d1ee3566
8 changed files with 15 additions and 45 deletions

View File

@ -181,13 +181,11 @@ AND date('now') BETWEEN start_date AND end_date;",
damage = BoatDamage::Locked;
}
let cat = if boat.external {
format!("Vereinsfremde Boote")
"Vereinsfremde Boote".to_string()
} else if boat.default_shipmaster_only_steering {
format!("{}+", boat.amount_seats - 1)
} else {
if boat.default_shipmaster_only_steering {
format!("{}+", boat.amount_seats - 1)
} else {
format!("{}x", boat.amount_seats)
}
format!("{}x", boat.amount_seats)
};
res.push(BoatWithDetails {

View File

@ -114,7 +114,7 @@ WHERE end_date >= CURRENT_DATE ORDER BY end_date
grouped_reservations
.entry(key)
.or_insert_with(Vec::new)
.or_default()
.push(reservation);
}

View File

@ -303,10 +303,10 @@ ORDER BY departure DESC
return Err(LogbookCreateError::BoatNotFound);
};
if log.shipmaster_only_steering != boat.default_shipmaster_only_steering {
if !boat.convert_handoperated_possible {
return Err(LogbookCreateError::CantChangeHandoperatableStatusForThisBoat);
}
if log.shipmaster_only_steering != boat.default_shipmaster_only_steering
&& !boat.convert_handoperated_possible
{
return Err(LogbookCreateError::CantChangeHandoperatableStatusForThisBoat);
}
if boat.amount_seats == 1 && log.rowers.is_empty() {

View File

@ -26,7 +26,7 @@ const REGULAR: i32 = 22000;
const UNTERSTUETZEND: i32 = 2500;
const FOERDERND: i32 = 8500;
#[derive(FromRow, Serialize, Deserialize, Clone, Debug, Eq, Hash)]
#[derive(FromRow, Serialize, Deserialize, Clone, Debug, Eq, Hash, PartialEq)]
pub struct User {
pub id: i64,
pub name: String,
@ -82,12 +82,6 @@ impl UserWithWaterStatus {
}
}
impl PartialEq for User {
fn eq(&self, other: &Self) -> bool {
self.id == other.id
}
}
#[derive(Debug)]
pub enum LoginError {
InvalidAuthenticationCombo,