improve code with clippy
This commit is contained in:
parent
1b58641100
commit
9331b2001d
@ -124,7 +124,7 @@ pub enum LogbookCreateError {
|
||||
|
||||
impl From<LogbookUpdateError> for LogbookCreateError {
|
||||
fn from(value: LogbookUpdateError) -> Self {
|
||||
return match value {
|
||||
match value {
|
||||
LogbookUpdateError::NotYourEntry => LogbookCreateError::NotYourEntry,
|
||||
LogbookUpdateError::TooManyRowers(a, b) => LogbookCreateError::TooManyRowers(a, b),
|
||||
LogbookUpdateError::RowerCreateError(a, b) => {
|
||||
@ -140,7 +140,7 @@ impl From<LogbookUpdateError> for LogbookCreateError {
|
||||
LogbookUpdateError::UserNotAllowedToUseBoat => {
|
||||
LogbookCreateError::UserNotAllowedToUseBoat
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -429,7 +429,7 @@ ORDER BY departure DESC
|
||||
return Err(LogbookUpdateError::SteeringPersonNotInRowers);
|
||||
}
|
||||
|
||||
if !boat.shipmaster_allowed(&user).await && self.shipmaster != user.id {
|
||||
if !boat.shipmaster_allowed(user).await && self.shipmaster != user.id {
|
||||
//second part:
|
||||
//shipmaster has
|
||||
//entered a
|
||||
|
@ -217,12 +217,10 @@ async fn create_kiosk(
|
||||
User::find_by_id(db, boat.owner.unwrap() as i32)
|
||||
.await
|
||||
.unwrap()
|
||||
} else {
|
||||
if let Some(shipmaster) = data.shipmaster {
|
||||
} else if let Some(shipmaster) = data.shipmaster {
|
||||
User::find_by_id(db, shipmaster as i32).await.unwrap()
|
||||
} else {
|
||||
User::find_by_id(db, data.rowers[0] as i32).await.unwrap()
|
||||
}
|
||||
};
|
||||
Log::create(
|
||||
db,
|
||||
|
Loading…
x
Reference in New Issue
Block a user