Skip to content

Commit

Permalink
shotover#1649 remove warning suppress
Browse files Browse the repository at this point in the history
  • Loading branch information
justinweng-instaclustr committed Jun 20, 2024
1 parent 3802898 commit 810799b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions shotover/src/transforms/query_counter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,12 @@ pub struct QueryCounterConfig {
}

impl QueryCounter {
#![allow(unused_must_use)] // Allow shotover_query_count counter to be not used
pub fn new(counter_name: String) -> Self {
// Leaking here is fine since the builder is created only once during shotover startup.
let counter_name_ref: &'static str = counter_name.leak();

// Although not incremented, this counter needs to be created to ensure shotover_query_count is 0 on shotover startup.
counter!("shotover_query_count", "name" => counter_name_ref);
let _ = counter!("shotover_query_count", "name" => counter_name_ref);

QueryCounter {
counter_name: counter_name_ref,
Expand Down

0 comments on commit 810799b

Please sign in to comment.