use super::*;
impl Default for MetricsOptions {
fn default() -> Self {
Self {
exclude_tests: false,
metrics: MetricSet::default(),
count_cyclomatic_try: true,
}
}
}
impl MetricsOptions {
#[inline]
#[must_use]
pub fn with_exclude_tests(mut self, exclude_tests: bool) -> Self {
self.exclude_tests = exclude_tests;
self
}
#[inline]
#[must_use]
pub fn with_count_cyclomatic_try(mut self, count: bool) -> Self {
self.count_cyclomatic_try = count;
self
}
#[inline]
#[must_use]
pub fn with_only(mut self, metrics: &[Metric]) -> Self {
self.metrics = MetricSet::from_slice_with_deps(metrics);
self
}
#[inline]
#[must_use]
pub fn with_metric_set(mut self, metrics: MetricSet) -> Self {
self.metrics = metrics.resolved();
self
}
}