diff --git a/vrp-cli/src/commands/solve.rs b/vrp-cli/src/commands/solve.rs index 79ba646f..aa5d5826 100644 --- a/vrp-cli/src/commands/solve.rs +++ b/vrp-cli/src/commands/solve.rs @@ -441,8 +441,7 @@ pub fn create_interruption_quota(max_time: Option) -> Arc { impl Quota for InterruptionQuota { fn is_reached(&self) -> bool { - self.inner.as_ref().map_or(false, |inner| inner.is_reached()) - || self.should_interrupt.load(Ordering::Relaxed) + self.inner.as_ref().is_some_and(|inner| inner.is_reached()) || self.should_interrupt.load(Ordering::Relaxed) } } diff --git a/vrp-cli/src/extensions/generate/plan.rs b/vrp-cli/src/extensions/generate/plan.rs index 7eee0331..d99a4878 100644 --- a/vrp-cli/src/extensions/generate/plan.rs +++ b/vrp-cli/src/extensions/generate/plan.rs @@ -56,8 +56,8 @@ pub(crate) fn generate_plan( let job_proto = get_random_item(problem_proto.plan.jobs.as_slice(), &rnd).unwrap(); // TODO implement more sophisticated logic for jobs with pickup and delivery - let keep_original_demand = job_proto.pickups.as_ref().map_or(false, |t| !t.is_empty()) - && job_proto.deliveries.as_ref().map_or(false, |t| !t.is_empty()); + let keep_original_demand = job_proto.pickups.as_ref().is_some_and(|t| !t.is_empty()) + && job_proto.deliveries.as_ref().is_some_and(|t| !t.is_empty()); Job { id: format!("job{job_idx}"),