From 462ee687636333f8f65ce0b82afac3ab1eeb92b2 Mon Sep 17 00:00:00 2001 From: Jonas_Jones <91549607+JonasunderscoreJones@users.noreply.github.com> Date: Sun, 28 Jan 2024 03:10:49 +0100 Subject: [PATCH] Fixed warnings --- src/v1/builtin/mod.rs | 2 +- src/v1/debug/mod.rs | 2 +- src/v1/kcomebacks/filter/mod.rs | 2 +- src/v1/kcomebacks/mod.rs | 2 +- src/v1/kcomebacks/upcoming/mod.rs | 2 +- src/v1/projects/filter/mod.rs | 2 +- src/v1/projects/mod.rs | 5 +++-- 7 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/v1/builtin/mod.rs b/src/v1/builtin/mod.rs index f975734..5ddb2de 100644 --- a/src/v1/builtin/mod.rs +++ b/src/v1/builtin/mod.rs @@ -1,6 +1,6 @@ use warp::Filter; -pub fn get_builtin_routes() -> impl warp::Filter + Clone { +pub fn get_builtin_routes() -> impl warp::Filter + Clone { warp::path("v1") .and((warp::path("help").map(|| "Please refer to the wiki at https://wiki.jonasjones.dev/Api/")) .or(warp::path("ping").map(|| "pong")) diff --git a/src/v1/debug/mod.rs b/src/v1/debug/mod.rs index 44256a0..db85e7a 100644 --- a/src/v1/debug/mod.rs +++ b/src/v1/debug/mod.rs @@ -1,6 +1,6 @@ use warp::Filter; -pub fn get_debug_routes() -> impl warp::Filter + Clone { +pub fn get_debug_routes() -> impl warp::Filter + Clone { warp::path("debug") .and(warp::path("headers").and(warp::header::headers_cloned().map(handle_with_headers))) } diff --git a/src/v1/kcomebacks/filter/mod.rs b/src/v1/kcomebacks/filter/mod.rs index 158bac2..5d6fb1b 100644 --- a/src/v1/kcomebacks/filter/mod.rs +++ b/src/v1/kcomebacks/filter/mod.rs @@ -6,7 +6,7 @@ use warp::Filter; use crate::{error_responses::{BadRequestError, InternalServerError}, v1::kcomebacks::{fetch_data, create_json_response, parse_item, Item as EntryItem}}; -pub fn get_kcomebacks_filter_routes() -> impl warp::Filter + Clone { +pub fn get_kcomebacks_filter_routes() -> impl warp::Filter + Clone { warp::path("filter") .and((warp::path("id").and(warp::get()).and(warp::query::>()).and_then(filter_id_handler)) .or(warp::path("getall").and(warp::get()).and(warp::query::>()).and_then(filter_getall_handler)) diff --git a/src/v1/kcomebacks/mod.rs b/src/v1/kcomebacks/mod.rs index 6ddb102..0a985a3 100644 --- a/src/v1/kcomebacks/mod.rs +++ b/src/v1/kcomebacks/mod.rs @@ -10,7 +10,7 @@ use filter::get_kcomebacks_filter_routes; use upcoming::get_kcomebacks_upcoming_routes; use crate::error_responses::InternalServerError; -pub fn get_kcomebacks_routes() -> impl warp::Filter + Clone { +pub fn get_kcomebacks_routes() -> impl warp::Filter + Clone { warp::path("v1").and(warp::path("kcomebacks")) .and(warp::path("last_update").and(warp::get()).and_then(last_update) diff --git a/src/v1/kcomebacks/upcoming/mod.rs b/src/v1/kcomebacks/upcoming/mod.rs index 0e29b44..6f23aff 100644 --- a/src/v1/kcomebacks/upcoming/mod.rs +++ b/src/v1/kcomebacks/upcoming/mod.rs @@ -4,7 +4,7 @@ use warp::Filter; use crate::v1::kcomebacks::filter::filter_daterange_handler; -pub fn get_kcomebacks_upcoming_routes() -> impl warp::Filter + Clone { +pub fn get_kcomebacks_upcoming_routes() -> impl warp::Filter + Clone { warp::path("upcoming") .and((warp::path("today").and(warp::get()).and(warp::query::>()).and_then(upcoming_today_handler)) .or(warp::path("week").and(warp::get()).and(warp::query::>()).and_then(upcoming_week_handler)) diff --git a/src/v1/projects/filter/mod.rs b/src/v1/projects/filter/mod.rs index d200078..952b81c 100644 --- a/src/v1/projects/filter/mod.rs +++ b/src/v1/projects/filter/mod.rs @@ -5,7 +5,7 @@ use warp::Filter; use crate::{error_responses::BadRequestError, v1::projects::{fetch_data, create_json_response, Project as EntryProject}}; -pub fn get_project_filter_routes() -> impl warp::Filter + Clone { +pub fn get_project_filter_routes() -> impl warp::Filter + Clone { warp::path("filter") .and((warp::path("getall").and(warp::get()).and(warp::query::>()).and_then(filter_getall_handler)) .or(warp::path("lastupdaterange").and(warp::get()).and(warp::query::>()).and_then(filter_lastupdaterange_handler)) diff --git a/src/v1/projects/mod.rs b/src/v1/projects/mod.rs index 61daf55..55689b1 100644 --- a/src/v1/projects/mod.rs +++ b/src/v1/projects/mod.rs @@ -10,12 +10,13 @@ use filter::get_project_filter_routes; use crate::error_responses::InternalServerError; -pub fn get_project_routes() -> impl warp::Filter + Clone { +pub fn get_project_routes() -> impl warp::Filter + Clone { warp::path("v1").and(warp::path("projects")) .and(warp::path("last_update").and(warp::get()).and_then(last_update) .or(warp::path("start_update").map(|| "Not implemented yet")) - .or(get_project_filter_routes())) + .or(get_project_filter_routes()) + ) } // get json data from https://https://cdn.jonasjones.dev/api/projects/projects.json