From a84560bbb73e0ec31567aac82fbb9ddc641b1952 Mon Sep 17 00:00:00 2001 From: Patrick Meade Date: Wed, 24 Jul 2024 15:25:14 -0500 Subject: [PATCH] Fix up CI issues --- src/routes/v1/disks.rs | 25 ++++++++++++------------- src/routes/v1/events.rs | 15 ++++++--------- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/src/routes/v1/disks.rs b/src/routes/v1/disks.rs index 5a91f9b..403f03b 100644 --- a/src/routes/v1/disks.rs +++ b/src/routes/v1/disks.rs @@ -2,7 +2,7 @@ use gotham::{router::response::StaticResponseExtender, state::StateData}; use gotham_restful::{endpoint, gotham::hyper::Method, read, search, Resource, Success}; -use log::{error, info}; +use log::info; use serde::{Deserialize, Serialize}; use crate::routes::v1::{EventResource, EventResources}; @@ -25,15 +25,13 @@ pub struct DiskResources { #[derive(Clone, Deserialize, StateData, StaticResponseExtender)] struct DiskSearchQuery { - serial_number: String, + _serial_number: String, } #[search] -fn find_disk_by_query(query: DiskSearchQuery) -> Success { +fn find_disk_by_query(_query: DiskSearchQuery) -> Success { info!("find_disk_by_query()"); - DiskResources { - disks: Vec::new() - }.into() + DiskResources { disks: Vec::new() }.into() } // -------------------------------------------------------------------------------------------------------------------- @@ -48,7 +46,7 @@ fn get_disk_by_id(disk_id: u64) -> Success { #[derive(Clone, Deserialize, StateData, StaticResponseExtender)] struct DiskAndEvent { - disk_id: u64, + _disk_id: u64, event_id: u64, } @@ -60,14 +58,17 @@ struct DiskAndEvent { )] fn get_event_by_disk_id_and_event_id(disk_and_event: DiskAndEvent) -> Success { info!("get_event_by_disk_id_and_event_id()"); - EventResource { id: disk_and_event.event_id }.into() + EventResource { + id: disk_and_event.event_id, + } + .into() } // -------------------------------------------------------------------------------------------------------------------- #[derive(Clone, Deserialize, StateData, StaticResponseExtender)] struct Disk { - disk_id: u64, + _disk_id: u64, } #[endpoint( @@ -76,9 +77,7 @@ struct Disk { params = false, body = false )] -fn get_events_by_disk_id(disk: Disk) -> Success { +fn get_events_by_disk_id(_disk: Disk) -> Success { info!("get_events_by_disk_id()"); - EventResources { - events: Vec::new() - }.into() + EventResources { events: Vec::new() }.into() } diff --git a/src/routes/v1/events.rs b/src/routes/v1/events.rs index 6c33ac7..82602b0 100644 --- a/src/routes/v1/events.rs +++ b/src/routes/v1/events.rs @@ -2,9 +2,8 @@ use gotham::{router::response::StaticResponseExtender, state::StateData}; use gotham_restful::{create, read, search, Resource, Success}; -use log::{error, info}; +use log::info; use serde::{Deserialize, Serialize}; -use serde_json::{json, Value}; #[derive(Resource, Serialize)] #[resource(create_event)] @@ -23,11 +22,11 @@ pub struct EventResources { #[derive(Clone, Deserialize, StateData, StaticResponseExtender)] struct EventBody { - serial_number: String, + _serial_number: String, } #[create] -fn create_event(body: EventBody) -> Success { +fn create_event(_body: EventBody) -> Success { info!("create_event()"); EventResource { id: 0 }.into() } @@ -36,15 +35,13 @@ fn create_event(body: EventBody) -> Success { #[derive(Clone, Deserialize, StateData, StaticResponseExtender)] struct EventSearchQuery { - serial_number: String, + _serial_number: String, } #[search] -fn find_event_by_query(query: EventSearchQuery) -> Success { +fn find_event_by_query(_query: EventSearchQuery) -> Success { info!("find_event_by_query()"); - EventResources { - events: Vec::new(), - }.into() + EventResources { events: Vec::new() }.into() } // --------------------------------------------------------------------------------------------------------------------