diff options
Diffstat (limited to 'src/handlers/talks.rs')
| -rw-r--r-- | src/handlers/talks.rs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/handlers/talks.rs b/src/handlers/talks.rs index b64575c..8db5c9e 100644 --- a/src/handlers/talks.rs +++ b/src/handlers/talks.rs @@ -5,15 +5,17 @@ use crate::{ templates::{self, Html, RenderRucte}, }; use lazy_static::lazy_static; -use prometheus::{IntCounterVec, register_int_counter_vec, opts}; +use prometheus::{opts, register_int_counter_vec, IntCounterVec}; use std::sync::Arc; -use warp::{http::Response, Rejection, Reply}; use tracing::instrument; +use warp::{http::Response, Rejection, Reply}; lazy_static! { - static ref HIT_COUNTER: IntCounterVec = - register_int_counter_vec!(opts!("talks_hits", "Number of hits to talks images"), &["name"]) - .unwrap(); + static ref HIT_COUNTER: IntCounterVec = register_int_counter_vec!( + opts!("talks_hits", "Number of hits to talks images"), + &["name"] + ) + .unwrap(); } #[instrument(skip(state))] @@ -35,7 +37,9 @@ pub async fn post_view(name: String, state: Arc<State>) -> Result<impl Reply, Re match want { None => Err(PostNotFound("talks".into(), name).into()), Some(post) => { - HIT_COUNTER.with_label_values(&[name.clone().as_str()]).inc(); + HIT_COUNTER + .with_label_values(&[name.clone().as_str()]) + .inc(); let body = Html(post.body_html.clone()); Response::builder().html(|o| templates::talkpost_html(o, post, body)) } |
