use crateParseError;
use FromStr;
/// Generic helper function for parsing and setting metrics. It checks for duplicate metrics
/// and invalid metric values.
///
/// # Arguments
///
/// * `field` - mutable reference to an Option field to be populated
/// * `value` - input value
/// * `key` - metric key used for error reporting
///
/// # Returns
///
/// * `Ok(())` if the metric was successfully parsed and set
/// * `Err(ParseError)` if the metric is a duplicate or if parsing fails
pub