Skip to content

Commit

Permalink
editoast: fix clippy lints in nightly
Browse files Browse the repository at this point in the history
Signed-off-by: Tristram Gräbener <tristram+git@tristramg.eu>
  • Loading branch information
Tristramg committed Jan 12, 2025
1 parent 86129e0 commit 53fa607
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions editoast/editoast_osrdyne_client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl OsrdyneClient {
Ok(res)
}

pub async fn get_workers_statuses<'a, T>(
pub async fn get_workers_statuses<T>(
&self,
keys: &[T],
) -> Result<HashMap<String, WorkerStatus>, Error>
Expand Down Expand Up @@ -127,7 +127,7 @@ struct OsrdyneWorkerMetadata {
}

impl HTTPClient {
pub async fn get_workers_statuses<'a, T>(
pub async fn get_workers_statuses<T>(
&self,
keys: &[T],
) -> Result<HashMap<String, WorkerStatus>, Error>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ impl<'de> Deserialize<'de> for TrainScheduleBase {
let first_point_id = &internal.path.first().unwrap().id;
if schedules
.get(first_point_id)
.map_or(false, |s| s.arrival.is_some())
.is_some_and(|s| s.arrival.is_some())
{
return Err(SerdeError::custom(
"First path waypoint can't have an arrival time",
Expand Down
2 changes: 1 addition & 1 deletion editoast/src/models/prelude/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub struct Patch<'a, T: Model> {
}

#[allow(unused)]
impl<'a, M: Model> Patch<'a, M> {
impl<M: Model> Patch<'_, M> {
/// Applies the patch changeset to update the model instance's row and updates
/// the model reference with its new values
///
Expand Down
4 changes: 2 additions & 2 deletions editoast/src/views/infra/edition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ crate::routes! {
(status = 200, body = Vec<InfraObject>, description = "The result of the operations")
)
)]
async fn edit<'a>(
async fn edit(
Path(InfraIdParam { infra_id }): Path<InfraIdParam>,
State(AppState {
db_pool,
Expand Down Expand Up @@ -123,7 +123,7 @@ async fn edit<'a>(
(status = 200, body = inline(Vec<String>), description = "ID of the trackSections created")
),
)]
pub async fn split_track_section<'a>(
pub async fn split_track_section(
Path(InfraIdParam { infra_id }): Path<InfraIdParam>,
State(AppState {
db_pool,
Expand Down
2 changes: 1 addition & 1 deletion editoast/src/views/infra/lines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ async fn get_line_bbox(
.track_sections()
.values()
.map(ObjectCache::unwrap_track_section)
.filter(|track| track.line_code.map_or(false, |code| code == line_code))
.filter(|track| track.line_code == Some(line_code))
.peekable();
if tracksections.peek().is_none() {
return Err(LinesErrors::LineNotFound { line_code }.into());
Expand Down
3 changes: 1 addition & 2 deletions editoast/src/views/infra/pathfinding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,7 @@ impl PathfindingStep {
}

self.previous
.as_ref()
.map_or(false, |p| p.is_using_switch(switch_id))
.as_ref().is_some_and(|p| p.is_using_switch(switch_id))
}
}

Expand Down
4 changes: 2 additions & 2 deletions editoast/src/views/train_schedule/projection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,9 @@ async fn compute_batch_signal_updates<'a>(
}

/// Compute space time curves of a list of train schedules
async fn compute_batch_space_time_curves<'a>(
async fn compute_batch_space_time_curves(
trains_details: &Vec<TrainSimulationDetails>,
path_projection: &PathProjection<'a>,
path_projection: &PathProjection<'_>,
) -> HashMap<i64, Vec<SpaceTimeCurve>> {
let mut space_time_curves = HashMap::new();

Expand Down

0 comments on commit 53fa607

Please sign in to comment.