Remove too simplistic url parse

This commit is contained in:
Dominik Werder
2021-06-23 07:32:18 +02:00
parent d0318a17c2
commit ebb1ce89dc
5 changed files with 45 additions and 61 deletions

View File

@@ -20,6 +20,7 @@ pub mod status;
pub mod streamext;
pub const APP_JSON: &'static str = "application/json";
pub const APP_JSON_LINES: &'static str = "application/jsonlines";
pub const APP_OCTET: &'static str = "application/octet-stream";
#[derive(Clone, Debug, Serialize, Deserialize)]
@@ -726,24 +727,6 @@ impl FromStr for AggKind {
}
}
pub fn query_params(q: Option<&str>) -> std::collections::BTreeMap<String, String> {
let mut map = std::collections::BTreeMap::new();
match q {
Some(k) => {
for par in k.split("&") {
let mut u = par.split("=");
if let Some(t1) = u.next() {
if let Some(t2) = u.next() {
map.insert(t1.into(), t2.into());
}
}
}
}
None => {}
}
map
}
pub trait ToNanos {
fn to_nanos(&self) -> u64;
}