From f5f35855ce343a3d44cfe3988309cc46f031c338 Mon Sep 17 00:00:00 2001 From: BitHeaven Date: Mon, 15 Jul 2024 08:43:36 +0300 Subject: [PATCH] Del duplicates in code --- src/url/api/mod.rs | 10 ++-------- src/url/api/v0.rs | 14 +++----------- src/url/api/v1.rs | 14 +++----------- 3 files changed, 8 insertions(+), 30 deletions(-) diff --git a/src/url/api/mod.rs b/src/url/api/mod.rs index ec4d233..1f35b2f 100644 --- a/src/url/api/mod.rs +++ b/src/url/api/mod.rs @@ -6,21 +6,15 @@ use { StatusCode, Request, header::HeaderValue, - body::{ - Incoming, - }, + body::Incoming, }, serde_json::{ Value as Json, json, }, - skytable::pool::ConnectionMgrTcp, - bb8::Pool, - std::sync::Arc, + crate::DBPool, }; -type DBPool = Arc>; - pub async fn endpoint(req: Request, pool: DBPool) -> (String, StatusCode, HeaderValue) { let uri: &str = req.uri().path().as_ref(); diff --git a/src/url/api/v0.rs b/src/url/api/v0.rs index f970298..2d53e36 100644 --- a/src/url/api/v0.rs +++ b/src/url/api/v0.rs @@ -1,28 +1,20 @@ use { hyper::{ Request, - body::{ - Incoming, - }, + body::Incoming, }, serde_json::{ Value as Json, json, }, - skytable::{ - pool::ConnectionMgrTcp, - query, - }, - bb8::Pool, - std::sync::Arc, + skytable::query, crate::{ + DBPool, time, double_split, }, }; -type DBPool = Arc>; - pub async fn api(req: Request, pool: DBPool) -> Json { let uri: &str = req.uri().path().as_ref(); diff --git a/src/url/api/v1.rs b/src/url/api/v1.rs index f970298..2d53e36 100644 --- a/src/url/api/v1.rs +++ b/src/url/api/v1.rs @@ -1,28 +1,20 @@ use { hyper::{ Request, - body::{ - Incoming, - }, + body::Incoming, }, serde_json::{ Value as Json, json, }, - skytable::{ - pool::ConnectionMgrTcp, - query, - }, - bb8::Pool, - std::sync::Arc, + skytable::query, crate::{ + DBPool, time, double_split, }, }; -type DBPool = Arc>; - pub async fn api(req: Request, pool: DBPool) -> Json { let uri: &str = req.uri().path().as_ref();