diff --git a/src/admin/route/mod.rs b/src/admin/route/mod.rs index 11a754c..92f81b4 100644 --- a/src/admin/route/mod.rs +++ b/src/admin/route/mod.rs @@ -154,7 +154,7 @@ DROP TABLE temp_pos;", self.stations(db) .await .into_iter() - .filter(|s| s.crewless()) + .filter(Station::crewless) .collect() } diff --git a/src/admin/station/mod.rs b/src/admin/station/mod.rs index 328e89b..bc3ceb1 100644 --- a/src/admin/station/mod.rs +++ b/src/admin/station/mod.rs @@ -450,10 +450,10 @@ AND r.left_at IS NOT NULL;", let missing_teams: Vec = stream::iter(teams) .filter_map(|entry| async move { - if !entry.been_at_station(db, &self).await { - Some(entry) - } else { + if entry.been_at_station(db, self).await { None + } else { + Some(entry) } }) .collect() diff --git a/src/admin/station/web.rs b/src/admin/station/web.rs index c159988..45349df 100644 --- a/src/admin/station/web.rs +++ b/src/admin/station/web.rs @@ -525,7 +525,7 @@ async fn quick_post( let mut ret = String::new(); let mut amount_succ = 0; - for (team_id, points) in form.fields.iter() { + for (team_id, points) in &form.fields { let Ok(team_id) = team_id.parse::() else { ret.push_str(&format!( "Skipped team_id={team_id} because this id can't be parsed as i64" diff --git a/src/admin/team/mod.rs b/src/admin/team/mod.rs index 252506e..d7b43b6 100644 --- a/src/admin/team/mod.rs +++ b/src/admin/team/mod.rs @@ -230,7 +230,7 @@ impl Team { } pub async fn been_at_station(&self, db: &SqlitePool, station: &Station) -> bool { - Rating::find_by_team_and_station(db, &self, station) + Rating::find_by_team_and_station(db, self, station) .await .is_some() } diff --git a/src/admin/team/web.rs b/src/admin/team/web.rs index f9d6462..9c70eca 100644 --- a/src/admin/team/web.rs +++ b/src/admin/team/web.rs @@ -66,7 +66,7 @@ async fn create( } }; - Redirect::to(&format!("/admin/team/{}", id)) + Redirect::to(&format!("/admin/team/{id}")) } async fn delete( @@ -119,7 +119,7 @@ async fn quick(db: Arc, team: &Team, stations: Vec, redirec } } td { - @if let Some(rating) = Rating::find_by_team_and_station(&db, &team, station).await { + @if let Some(rating) = Rating::find_by_team_and_station(&db, team, station).await { a href=(format!("/s/{}/{}", station.id, station.pw)){ @if let Some(points) = rating.points { em data-tooltip="Schon eingetragen" { @@ -208,7 +208,7 @@ async fn quick_post( let mut ret = String::new(); let mut amount_succ = 0; - for (station_id, points) in form.fields.iter() { + for (station_id, points) in &form.fields { let Ok(station_id) = station_id.parse::() else { ret.push_str(&format!( "Skipped stationid={station_id} because this id can't be parsed as i64" @@ -217,8 +217,7 @@ async fn quick_post( }; let Ok(points) = points.parse::() else { ret.push_str(&format!( - "Skipped stationid={station_id} because points {} can't be parsed as i64", - points + "Skipped stationid={station_id} because points {points} can't be parsed as i64", )); continue; }; diff --git a/src/admin/user/web.rs b/src/admin/user/web.rs index d22f837..8caa1ca 100644 --- a/src/admin/user/web.rs +++ b/src/admin/user/web.rs @@ -37,7 +37,7 @@ async fn create( } }; - Redirect::to(&format!("/admin/user/{}", id)) + Redirect::to(&format!("/admin/user/{id}")) } async fn delete(