@@ -1454,10 +1454,10 @@ impl DatabaseQueue for TestQueue {
1454
1454
crate :: priority:: JobPriority :: High ,
1455
1455
crate :: priority:: JobPriority :: Critical ,
1456
1456
] {
1457
- job_counts. insert ( priority. clone ( ) , 0 ) ;
1458
- avg_processing_times. insert ( priority. clone ( ) , 0.0 ) ;
1459
- recent_throughput. insert ( priority. clone ( ) , 0 ) ;
1460
- priority_distribution. insert ( priority. clone ( ) , 0.0 ) ;
1457
+ job_counts. insert ( priority, 0 ) ;
1458
+ avg_processing_times. insert ( priority, 0.0 ) ;
1459
+ recent_throughput. insert ( priority, 0 ) ;
1460
+ priority_distribution. insert ( priority, 0.0 ) ;
1461
1461
}
1462
1462
1463
1463
let mut total_jobs = 0u64 ;
@@ -1466,7 +1466,7 @@ impl DatabaseQueue for TestQueue {
1466
1466
for jobs in queue_jobs. values ( ) {
1467
1467
for job_id in jobs {
1468
1468
if let Some ( job) = storage. jobs . get ( job_id) {
1469
- * job_counts. entry ( job. priority . clone ( ) ) . or_insert ( 0 ) += 1 ;
1469
+ * job_counts. entry ( job. priority ) . or_insert ( 0 ) += 1 ;
1470
1470
total_jobs += 1 ;
1471
1471
1472
1472
// Calculate processing time if job is completed
@@ -1475,7 +1475,7 @@ impl DatabaseQueue for TestQueue {
1475
1475
let current_avg = avg_processing_times. get ( & job. priority ) . unwrap_or ( & 0.0 ) ;
1476
1476
let current_count = * job_counts. get ( & job. priority ) . unwrap_or ( & 1 ) ;
1477
1477
let new_avg = ( current_avg * ( current_count - 1 ) as f64 + processing_time) / current_count as f64 ;
1478
- avg_processing_times. insert ( job. priority . clone ( ) , new_avg) ;
1478
+ avg_processing_times. insert ( job. priority , new_avg) ;
1479
1479
}
1480
1480
}
1481
1481
}
@@ -1489,7 +1489,7 @@ impl DatabaseQueue for TestQueue {
1489
1489
} else {
1490
1490
0.0
1491
1491
} ;
1492
- priority_distribution. insert ( priority. clone ( ) , percentage) ;
1492
+ priority_distribution. insert ( * priority, percentage) ;
1493
1493
}
1494
1494
1495
1495
Ok ( crate :: priority:: PriorityStats {
0 commit comments