From aad9c870ffe65b3fe7f103e28a3ae34c09c9cf32 Mon Sep 17 00:00:00 2001 From: reinterpretcat Date: Thu, 25 Jul 2024 19:29:25 +0200 Subject: [PATCH] Update rust toolchain and fix clippy warnings --- CHANGELOG.md | 4 ++++ Dockerfile | 2 +- rosomaxa/src/algorithms/math/remedian.rs | 4 ++-- vrp-cli/Cargo.toml | 2 +- vrp-cli/src/lib.rs | 2 +- vrp-core/src/construction/heuristics/insertions.rs | 4 +--- vrp-core/src/models/goal.rs | 14 +++++++------- 7 files changed, 17 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f17e3150a..e4e425178 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ are already published. So, I stick to it for now. ## [Unreleased] +### Changed + +* update rust version + ## [1.24.0] 2024-07-13 diff --git a/Dockerfile b/Dockerfile index 1ff45b491..764be9169 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.79-alpine AS Builder +FROM rust:1.80-alpine AS Builder LABEL maintainer="Ilya Builuk " \ org.opencontainers.image.title="A Vehicle Routing Problem solver CLI" \ diff --git a/rosomaxa/src/algorithms/math/remedian.rs b/rosomaxa/src/algorithms/math/remedian.rs index 2d0d9e653..a7a3a5fb6 100644 --- a/rosomaxa/src/algorithms/math/remedian.rs +++ b/rosomaxa/src/algorithms/math/remedian.rs @@ -11,9 +11,9 @@ pub type RemedianUsize = Remedian Ordering>; /// /// References: /// - P.J. Rousseeuw, G.W. Bassett Jr., "The remedian: A robust averaging method for large data sets", -/// Journal of the American Statistical Association, vol. 85 (1990), pp. 97-104 +/// Journal of the American Statistical Association, vol. 85 (1990), pp. 97-104 /// - Domenico Cantone, Micha Hofri, "Further analysis of the remedian algorithm", Theoretical Computer -/// Science, vol. 495 (2013), pp. 1-16 +/// Science, vol. 495 (2013), pp. 1-16 pub struct Remedian where T: Clone, diff --git a/vrp-cli/Cargo.toml b/vrp-cli/Cargo.toml index a5234652d..225908fae 100644 --- a/vrp-cli/Cargo.toml +++ b/vrp-cli/Cargo.toml @@ -33,7 +33,7 @@ serde_json.workspace = true csv = { version = "1.3.0", optional = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -clap = "4.5.9" +clap = "4.5.11" ctrlc = { version = "3.4.4", features = ["termination"] } num_cpus = "1.16.0" diff --git a/vrp-cli/src/lib.rs b/vrp-cli/src/lib.rs index b51c99c1b..3fc2649ad 100644 --- a/vrp-cli/src/lib.rs +++ b/vrp-cli/src/lib.rs @@ -338,7 +338,7 @@ mod c_interop { } #[cfg(feature = "py_bindings")] -#[cfg(all(not(target_arch = "wasm32"), not(tarpaulin)))] +#[cfg(not(target_arch = "wasm32"))] mod py_interop { use super::*; use crate::extensions::solve::config::read_config; diff --git a/vrp-core/src/construction/heuristics/insertions.rs b/vrp-core/src/construction/heuristics/insertions.rs index ccfec38a6..6ad0b643c 100644 --- a/vrp-core/src/construction/heuristics/insertions.rs +++ b/vrp-core/src/construction/heuristics/insertions.rs @@ -255,14 +255,12 @@ impl InsertionHeuristic { /// Runs common insertion heuristic algorithm using given selector specializations. pub fn process( &self, - insertion_ctx: InsertionContext, + mut insertion_ctx: InsertionContext, job_selector: &(dyn JobSelector + Send + Sync), route_selector: &(dyn RouteSelector + Send + Sync), leg_selection: &LegSelection, result_selector: &(dyn ResultSelector + Send + Sync), ) -> InsertionContext { - let mut insertion_ctx = insertion_ctx; - prepare_insertion_ctx(&mut insertion_ctx); while !insertion_ctx.solution.required.is_empty() diff --git a/vrp-core/src/models/goal.rs b/vrp-core/src/models/goal.rs index 1b27e28c0..7759f201e 100644 --- a/vrp-core/src/models/goal.rs +++ b/vrp-core/src/models/goal.rs @@ -243,14 +243,14 @@ impl GoalBuilder { /// job values, etc. Each feature consists of three optional parts (but at least one should be defined): /// /// * **constraint**: an invariant which should be hold to have a feasible VRP solution in the end. -/// A good examples are hard constraints such as capacity, time, travel limits, etc. +/// A good examples are hard constraints such as capacity, time, travel limits, etc. /// /// * **objective**: an objective of the optimization such as minimization of unassigned jobs or tours. -/// All objectives form together a hierarchy which describes a goal of optimization, including -/// various soft constraints: assignment of preferred jobs, optional breaks, etc. This helps to -/// guide the search on the global objective level (e.g. comparison of various solutions in order to -/// find out which one is "better") and local objective level (e.g. which job should be inserted next -/// into specific solution). +/// All objectives form together a hierarchy which describes a goal of optimization, including +/// various soft constraints: assignment of preferred jobs, optional breaks, etc. This helps to +/// guide the search on the global objective level (e.g. comparison of various solutions in order to +/// find out which one is "better") and local objective level (e.g. which job should be inserted next +/// into specific solution). /// /// * **state**: the corresponding cached data of constraint/objective to speed up/control their evaluations. /// @@ -260,7 +260,7 @@ impl GoalBuilder { /// * hard constraint can be defined without objective as this is an invariant /// * state should be used to avoid expensive calculations during insertion evaluation phase. /// `FeatureObjective::estimate` and `FeatureConstraint::evaluate` methods are called during this phase. -/// Additionally, it can be used to do some solution modifications at `FeatureState::accept_solution_state`. +/// Additionally, it can be used to do some solution modifications at `FeatureState::accept_solution_state`. #[derive(Clone, Default)] pub struct Feature { /// An unique id of the feature.