fix: clippy warnings, or_fun_call and unnecessary_lazy_evaluations (#846)

This commit is contained in:
Kim, JinSan
2023-01-13 19:10:02 +09:00
committed by GitHub
parent e6ca4c56c6
commit c4bafe809b
8 changed files with 28 additions and 38 deletions

View File

@ -97,7 +97,7 @@ fn parse_metrics_attr(node: &DeriveInput) -> Result<MetricsAttr> {
}
}
let scope = scope.ok_or(Error::new_spanned(node, "`scope = ..` must be set."))?;
let scope = scope.ok_or_else(|| Error::new_spanned(node, "`scope = ..` must be set."))?;
Ok(MetricsAttr { scope, separator })
}