Skip to content

Commit

Permalink
remove RequestSource::parse
Browse files Browse the repository at this point in the history
  • Loading branch information
poltao committed May 12, 2024
1 parent a87f6c1 commit 4dadb21
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
10 changes: 0 additions & 10 deletions src/servers/src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use std::collections::HashMap;
use std::fmt::Display;
use std::net::SocketAddr;
use std::str::FromStr;
use std::sync::Mutex as StdMutex;
use std::time::Duration;

Expand Down Expand Up @@ -350,15 +349,6 @@ pub enum RequestSource {
Dashboard,
}

impl RequestSource {
pub fn parse(s: &str) -> Option<Self> {
match RequestSource::from_str(s) {
Ok(v) => Some(v),
_ => None,
}
}
}

#[derive(Serialize, Deserialize, Debug, JsonSchema)]
pub enum HttpResponse {
Arrow(ArrowResponse),
Expand Down
3 changes: 2 additions & 1 deletion src/servers/src/http/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

use std::collections::HashMap;
use std::env;
use std::str::FromStr;
use std::time::Instant;

use aide::transform::TransformOperation;
Expand Down Expand Up @@ -97,7 +98,7 @@ pub async fn sql(
.map(|s| Epoch::parse(s.as_str()).unwrap_or(Epoch::Millisecond));
let source = query_params
.source
.and_then(|s| RequestSource::parse(s.as_str()));
.and_then(|s| RequestSource::from_str(s.as_str()).ok());

let result = if let Some(sql) = &sql {
if let Some((status, msg)) = validate_schema(sql_handler.clone(), query_ctx.clone()).await {
Expand Down

0 comments on commit 4dadb21

Please sign in to comment.