review fixes

This commit is contained in:
mohandasspat 2022-08-12 12:44:14 +05:30
parent 1f1482e97c
commit 0b6ca73790

View File

@ -303,8 +303,7 @@ pub async fn get_metrics(
.encode(&prometheus::gather(), &mut buffer) .encode(&prometheus::gather(), &mut buffer)
.expect("Failed to encode metrics"); .expect("Failed to encode metrics");
let response = String::from_utf8(buffer.clone()).expect("Failed to convert bytes to string"); let response = String::from_utf8(buffer).expect("Failed to convert bytes to string");
buffer.clear();
Ok(HttpResponse::Ok() Ok(HttpResponse::Ok()
.insert_header(header::ContentType(mime::TEXT_PLAIN)) .insert_header(header::ContentType(mime::TEXT_PLAIN))