Skip to content

Commit 0b4d5db

Browse files
committed
add impl TaskEstimator for Arc<&dyn TaskEstimator>
1 parent 5e671e0 commit 0b4d5db

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/distributed_planner/task_estimator.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,16 @@ impl TaskEstimator for usize {
6060
}
6161
}
6262

63+
impl TaskEstimator for Arc<dyn TaskEstimator> {
64+
fn estimate_tasks(
65+
&self,
66+
plan: &Arc<dyn ExecutionPlan>,
67+
cfg: &ConfigOptions,
68+
) -> Option<TaskEstimation> {
69+
self.as_ref().estimate_tasks(plan, cfg)
70+
}
71+
}
72+
6373
impl<F: Fn(&Arc<dyn ExecutionPlan>, &ConfigOptions) -> Option<TaskEstimation>> TaskEstimator for F {
6474
fn estimate_tasks(
6575
&self,

0 commit comments

Comments
 (0)