mirror of
https://github.com/JonasunderscoreJones/jonas_jones-api.git
synced 2025-10-22 16:59:17 +02:00
Fixed warnings
This commit is contained in:
parent
f201bc7fda
commit
462ee68763
7 changed files with 9 additions and 8 deletions
|
@ -1,6 +1,6 @@
|
|||
use warp::Filter;
|
||||
|
||||
pub fn get_builtin_routes() -> impl warp::Filter<Extract = impl warp::Reply, Error = warp::Rejection> + Clone {
|
||||
pub fn get_builtin_routes() -> impl warp::Filter<Extract = impl warp::Reply + warp::generic::Tuple, Error = warp::Rejection> + 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"))
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use warp::Filter;
|
||||
|
||||
pub fn get_debug_routes() -> impl warp::Filter<Extract = impl warp::Reply, Error = warp::Rejection> + Clone {
|
||||
pub fn get_debug_routes() -> impl warp::Filter<Extract = impl warp::Reply + warp::generic::Tuple, Error = warp::Rejection> + Clone {
|
||||
warp::path("debug")
|
||||
.and(warp::path("headers").and(warp::header::headers_cloned().map(handle_with_headers)))
|
||||
}
|
||||
|
|
|
@ -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<Extract = impl warp::Reply, Error = warp::Rejection> + Clone {
|
||||
pub fn get_kcomebacks_filter_routes() -> impl warp::Filter<Extract = impl warp::Reply + warp::generic::Tuple, Error = warp::Rejection> + Clone {
|
||||
warp::path("filter")
|
||||
.and((warp::path("id").and(warp::get()).and(warp::query::<HashMap<String, String>>()).and_then(filter_id_handler))
|
||||
.or(warp::path("getall").and(warp::get()).and(warp::query::<HashMap<String, String>>()).and_then(filter_getall_handler))
|
||||
|
|
|
@ -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<Extract = impl warp::Reply, Error = warp::Rejection> + Clone {
|
||||
pub fn get_kcomebacks_routes() -> impl warp::Filter<Extract = impl warp::Reply + warp::generic::Tuple, Error = warp::Rejection> + Clone {
|
||||
warp::path("v1").and(warp::path("kcomebacks"))
|
||||
|
||||
.and(warp::path("last_update").and(warp::get()).and_then(last_update)
|
||||
|
|
|
@ -4,7 +4,7 @@ use warp::Filter;
|
|||
|
||||
use crate::v1::kcomebacks::filter::filter_daterange_handler;
|
||||
|
||||
pub fn get_kcomebacks_upcoming_routes() -> impl warp::Filter<Extract = impl warp::Reply, Error = warp::Rejection> + Clone {
|
||||
pub fn get_kcomebacks_upcoming_routes() -> impl warp::Filter<Extract = impl warp::Reply + warp::generic::Tuple, Error = warp::Rejection> + Clone {
|
||||
warp::path("upcoming")
|
||||
.and((warp::path("today").and(warp::get()).and(warp::query::<HashMap<String, String>>()).and_then(upcoming_today_handler))
|
||||
.or(warp::path("week").and(warp::get()).and(warp::query::<HashMap<String, String>>()).and_then(upcoming_week_handler))
|
||||
|
|
|
@ -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<Extract = impl warp::Reply, Error = warp::Rejection> + Clone {
|
||||
pub fn get_project_filter_routes() -> impl warp::Filter<Extract = impl warp::Reply + warp::generic::Tuple, Error = warp::Rejection> + Clone {
|
||||
warp::path("filter")
|
||||
.and((warp::path("getall").and(warp::get()).and(warp::query::<HashMap<String, String>>()).and_then(filter_getall_handler))
|
||||
.or(warp::path("lastupdaterange").and(warp::get()).and(warp::query::<HashMap<String, String>>()).and_then(filter_lastupdaterange_handler))
|
||||
|
|
|
@ -10,12 +10,13 @@ use filter::get_project_filter_routes;
|
|||
|
||||
use crate::error_responses::InternalServerError;
|
||||
|
||||
pub fn get_project_routes() -> impl warp::Filter<Extract = impl warp::Reply, Error = warp::Rejection> + Clone {
|
||||
pub fn get_project_routes() -> impl warp::Filter<Extract = impl warp::Reply + warp::generic::Tuple, Error = warp::Rejection> + 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue