Skip to content

Commit

Permalink
Fix remaining clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
reinterpretcat committed Jan 12, 2025
1 parent 0c1e933 commit 784194b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions vrp-cli/src/commands/solve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,7 @@ pub fn create_interruption_quota(max_time: Option<usize>) -> Arc<dyn Quota> {

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)
}
}

Expand Down
4 changes: 2 additions & 2 deletions vrp-cli/src/extensions/generate/plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}"),
Expand Down

0 comments on commit 784194b

Please sign in to comment.