File tree Expand file tree Collapse file tree
datafusion/physical-expr-common/src/metrics Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,11 +26,11 @@ mod value;
2626use datafusion_common:: HashMap ;
2727pub use datafusion_common:: format:: { MetricCategory , MetricType } ;
2828use parking_lot:: Mutex ;
29- use std:: vec:: IntoIter ;
3029use 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
You can’t perform that action at this time.
0 commit comments