From 289778f601dc330c3ad9babf651a5a64a8bed953 Mon Sep 17 00:00:00 2001 From: Ning Sun Date: Thu, 27 Oct 2022 19:48:40 +0800 Subject: [PATCH] refactor: removed HttpResponse completely --- src/servers/src/http.rs | 8 +------- src/servers/src/http/influxdb.rs | 5 ++--- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/servers/src/http.rs b/src/servers/src/http.rs index d87b92a069..9c3648bed7 100644 --- a/src/servers/src/http.rs +++ b/src/servers/src/http.rs @@ -11,13 +11,7 @@ use aide::axum::{ApiRouter, IntoApiResponse}; use aide::openapi::{Info, OpenApi}; use async_trait::async_trait; use axum::Extension; -use axum::{ - error_handling::HandleErrorLayer, - http::header, - response::IntoResponse, - response::{Json, Response}, - routing, BoxError, Router, -}; +use axum::{error_handling::HandleErrorLayer, response::Json, routing, BoxError, Router}; use common_query::Output; use common_recordbatch::{util, RecordBatch}; use common_telemetry::logging::info; diff --git a/src/servers/src/http/influxdb.rs b/src/servers/src/http/influxdb.rs index b9c68fbd8f..cef1716b7a 100644 --- a/src/servers/src/http/influxdb.rs +++ b/src/servers/src/http/influxdb.rs @@ -6,7 +6,6 @@ use common_grpc::writer::Precision; use crate::error::Result; use crate::error::TimePrecisionSnafu; -use crate::http::HttpResponse; use crate::influxdb::InfluxdbRequest; use crate::query_handler::InfluxdbLineProtocolHandlerRef; @@ -15,14 +14,14 @@ pub async fn influxdb_write( State(handler): State, Query(params): Query>, lines: String, -) -> Result<(StatusCode, HttpResponse)> { +) -> Result<(StatusCode, ())> { let precision = params .get("precision") .map(|val| parse_time_precision(val)) .transpose()?; let request = InfluxdbRequest { precision, lines }; handler.exec(&request).await?; - Ok((StatusCode::NO_CONTENT, HttpResponse::Text("".to_string()))) + Ok((StatusCode::NO_CONTENT, ())) } fn parse_time_precision(value: &str) -> Result {