fn remove_metric(&mut self, key: &str) -> Option<Metric> {
        if let Some(metrics) = &mut self.metrics {
            if let Some(i) = metrics.iter().position(|metric| metric.key == key) {
                return Some(metrics.remove(i));
            }
        }
        None
    }
/// Removes the metric with the given key on the given Object. Returns the removed value if it
/// existed.
Removes the metric with the given key on the given Object. Returns the removed value if it
existed.
Removes the metric with the given key on the given Object . Returns the removed value if it existed .
fn remove_metric(&mut self, key: &str) -> Option<Metric> {
        if let Some(metrics) = &mut self.metrics {
            if let Some(i) = metrics.iter().position(|metric| metric.key == key) {
                return Some(metrics.remove(i));
            }
        }
        None
    }
fn remove_metric ( & mut self , key : & str ) -> Option < Metric > { if let Some ( metrics ) = & mut self . metrics { if let Some ( i ) = metrics . iter ( ) . position ( | metric | metric . key == key ) { return Some ( metrics . remove ( i ) ) ; } } None }
Removes the metric with the given key on the given Object.
Removes the metric with the given key on the given Object .
&mut self
key
&str
&mut self
key
&str