Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

editoast: fix clippy lints in nightly #10328

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion editoast/src/views/infra/pathfinding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ impl PathfindingStep {

self.previous
.as_ref()
.map_or(false, |p| p.is_using_switch(switch_id))
.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
Loading