Skip to content

Commit f84d26c

Browse files
committed
Answer to feedback
1 parent 89218ba commit f84d26c

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

  • datafusion/physical-expr-common/src/metrics

datafusion/physical-expr-common/src/metrics/mod.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ mod value;
2626
use datafusion_common::HashMap;
2727
pub use datafusion_common::format::{MetricCategory, MetricType};
2828
use parking_lot::Mutex;
29-
use std::vec::IntoIter;
3029
use std::{
3130
borrow::Cow,
3231
fmt::{self, Debug, Display},
3332
sync::Arc,
33+
vec::IntoIter,
3434
};
3535

3636
// public exports
@@ -227,7 +227,7 @@ impl MetricsSet {
227227
}
228228

229229
/// Extends the current list of metrics with the provided ones
230-
pub fn extend(&mut self, metrics: impl Iterator<Item = Arc<Metric>>) {
230+
pub fn extend(&mut self, metrics: impl IntoIterator<Item = Arc<Metric>>) {
231231
self.metrics.extend(metrics)
232232
}
233233

@@ -447,6 +447,14 @@ impl IntoIterator for MetricsSet {
447447
}
448448
}
449449

450+
impl FromIterator<Arc<Metric>> for MetricsSet {
451+
fn from_iter<T: IntoIterator<Item = Arc<Metric>>>(iter: T) -> Self {
452+
Self {
453+
metrics: iter.into_iter().collect(),
454+
}
455+
}
456+
}
457+
450458
/// A set of [`Metric`]s for an individual operator.
451459
///
452460
/// This structure is intended as a convenience for execution plan

0 commit comments

Comments
 (0)