diff --git a/src/tesla_charge_rate.rs b/src/tesla_charge_rate.rs index abc4776..65fb5bb 100644 --- a/src/tesla_charge_rate.rs +++ b/src/tesla_charge_rate.rs @@ -129,7 +129,7 @@ fn get_control(pl_state: &PlState, charge_state: &ChargeState) -> Option Option { let config = access_config(); - let new = rate.min(config.max_rate).max(config.min_rate); + let new = rate.clamp(config.min_rate, config.max_rate); if new == other { None } else {