понять реальный тип статическо пременной?
lazy_static! {
pub static ref REQUEST: HistogramVec =
register_histogram_vec!("request", "Request general metric", &["module", "endpoint"]).unwrap();
pub static ref HISTOGRAMS: HashMap<&'static str, HistogramVec> = hashmap!{
"request" => REQUEST,
};
}
12 | pub static ref HISTOGRAMS: HashMap<&'static str, HistogramVec> = hashmap!{
| ________________________________-----------------------------------___^
| | |
| | expected `std::collections::HashMap<&'static str, prometheus::core::MetricVec<prometheus::histogram::HistogramVecBuilder>>` because of return type
| |_____^ expected struct `prometheus::core::MetricVec`, found struct `http_routes::metrics::REQUEST`
Используй once_cell
Обсуждают сегодня