From c5d8dadacae64e0f290dc8275dc5146c8e1a5bc3 Mon Sep 17 00:00:00 2001 From: Jae-Won Chung Date: Thu, 30 May 2024 00:09:48 -0400 Subject: [PATCH] Change router macro parameter style --- zeusd/src/routes/gpu.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/zeusd/src/routes/gpu.rs b/zeusd/src/routes/gpu.rs index b26ebfe1..314f1f19 100644 --- a/zeusd/src/routes/gpu.rs +++ b/zeusd/src/routes/gpu.rs @@ -26,7 +26,7 @@ use crate::error::ZeusdError; /// - The `GpuCommand` variant name is the same as the API name, but the former is camel case /// and the latter is snake case (e.g., SetPowerLimit vs. set_power_limit). macro_rules! impl_handler_for_gpu_command { - ($api:ident, $path:expr, $($field:ident <$ftype:ty>,)*) => { + ($api:ident, $path:expr, $($field:ident: $ftype:ty,)*) => { paste! { // Request payload structure. #[derive(Serialize, Deserialize, Debug)] @@ -82,20 +82,20 @@ macro_rules! impl_handler_for_gpu_command { impl_handler_for_gpu_command!( set_persistence_mode, post("/{gpu_id}/set_persistence_mode"), - enabled, + enabled: bool, ); impl_handler_for_gpu_command!( set_power_limit, post("/{gpu_id}/set_power_limit"), - power_limit_mw, + power_limit_mw: u32, ); impl_handler_for_gpu_command!( set_gpu_locked_clocks, post("/{gpu_id}/set_gpu_locked_clocks"), - min_clock_mhz, - max_clock_mhz, + min_clock_mhz: u32, + max_clock_mhz: u32, ); impl_handler_for_gpu_command!( @@ -106,8 +106,8 @@ impl_handler_for_gpu_command!( impl_handler_for_gpu_command!( set_mem_locked_clocks, post("/{gpu_id}/set_mem_locked_clocks"), - min_clock_mhz, - max_clock_mhz, + min_clock_mhz: u32, + max_clock_mhz: u32, ); impl_handler_for_gpu_command!(