Skip to content

Commit

Permalink
Change router macro parameter style
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywonchung committed May 30, 2024
1 parent 85bac44 commit c5d8dad
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions zeusd/src/routes/gpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down Expand Up @@ -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<bool>,
enabled: bool,
);

impl_handler_for_gpu_command!(
set_power_limit,
post("/{gpu_id}/set_power_limit"),
power_limit_mw<u32>,
power_limit_mw: u32,
);

impl_handler_for_gpu_command!(
set_gpu_locked_clocks,
post("/{gpu_id}/set_gpu_locked_clocks"),
min_clock_mhz<u32>,
max_clock_mhz<u32>,
min_clock_mhz: u32,
max_clock_mhz: u32,
);

impl_handler_for_gpu_command!(
Expand All @@ -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<u32>,
max_clock_mhz<u32>,
min_clock_mhz: u32,
max_clock_mhz: u32,
);

impl_handler_for_gpu_command!(
Expand Down

0 comments on commit c5d8dad

Please sign in to comment.