index : license-api-rs.git

ascending towards madness

author holly sparkles <sparkles@holly.sh> 2023-10-08 19:30:11.0 +00:00:00
committer holly sparkles <sparkles@holly.sh> 2023-10-08 19:30:11.0 +00:00:00
commit
591bba449cc941b447c8a24710a0cce92e98efae [patch]
tree
3492b9b514cc9871cb3087e51f6c0be77ee013df
parent
9ecb54ff39cdb50e5082dbe1f0ce5cd64d94b6a8
download
591bba449cc941b447c8a24710a0cce92e98efae.tar.gz

refactor: remove unnecessary logging



Diff

 src/main.rs | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/src/main.rs b/src/main.rs
index 07abf2c..c1d66c9 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -81,8 +81,6 @@ fn build_response(status: StatusCode, data: String) -> Response {
}

async fn get_welcome_message(req: tide::Request<RunningConfig>) -> tide::Result<Response> {
    log::info!("{:?}", req);

    Ok(build_response(
        StatusCode::Ok,
        format!("{}", "Welcome message goes here").to_string(),
@@ -90,14 +88,10 @@ async fn get_welcome_message(req: tide::Request<RunningConfig>) -> tide::Result<
}

async fn get_fallback_response(req: tide::Request<RunningConfig>) -> tide::Result<Response> {
    log::error!("{:?}", req);

    Ok(error_response(req.url().path()))
}

async fn get_license_list(req: tide::Request<RunningConfig>) -> tide::Result<Response> {
    log::info!("{:?}", req);

    // TODO: env var the chunks
    match req.state().database.get_licenses(5) {
        Some(licenses) => Ok(build_response(StatusCode::Ok, format!("{}", licenses))),
@@ -109,8 +103,6 @@ async fn get_license_list(req: tide::Request<RunningConfig>) -> tide::Result<Res
}

async fn get_detailed_license_list(req: tide::Request<RunningConfig>) -> tide::Result<Response> {
    log::info!("{:?}", req);

    match req.state().database.get_detailed_licenses() {
        Some(licenses) => Ok(build_response(StatusCode::Ok, format!("{}", licenses))),
        None => Ok(build_response(
@@ -121,8 +113,6 @@ async fn get_detailed_license_list(req: tide::Request<RunningConfig>) -> tide::R
}

async fn get_requested_license(req: tide::Request<RunningConfig>) -> tide::Result<Response> {
    log::info!("{:?}", req);

    // remove prefix from requested route
    // TODO: make this better
    let request = req.url().path().strip_prefix("/").unwrap_or("");