diff --git a/meilisearch-http/src/routes/mod.rs b/meilisearch-http/src/routes/mod.rs index 6d7a6f27a..8f5c9f3d4 100644 --- a/meilisearch-http/src/routes/mod.rs +++ b/meilisearch-http/src/routes/mod.rs @@ -294,8 +294,7 @@ pub async fn get_metrics( .encode(&prometheus::gather(), &mut buffer) .expect("Failed to encode metrics"); - let response = String::from_utf8(buffer.clone()).expect("Failed to convert bytes to string"); - buffer.clear(); + let response = String::from_utf8(buffer).expect("Failed to convert bytes to string"); Ok(HttpResponse::Ok() .insert_header(header::ContentType(mime::TEXT_PLAIN))