mirror of
https://github.com/RGBCube/superfreq
synced 2025-07-27 17:07:44 +00:00
main: revert un-idiomatic \err.into()\
pattern
This commit is contained in:
parent
b170fa0dd0
commit
601735957b
1 changed files with 3 additions and 5 deletions
|
@ -464,15 +464,13 @@ fn init_logger() {
|
|||
fn validate_freq(freq_mhz: u32, label: &str) -> Result<(), AppError> {
|
||||
if freq_mhz == 0 {
|
||||
error!("{label} frequency cannot be zero");
|
||||
let err = ControlError::InvalidValueError(format!("{label} frequency cannot be zero"));
|
||||
Err(err.into())
|
||||
Err(AppError::Generic(format!("{label} frequency cannot be zero")))
|
||||
} else if freq_mhz > 10000 {
|
||||
// Extremely high value unlikely to be valid
|
||||
error!("{label} frequency ({freq_mhz} MHz) is unreasonably high");
|
||||
let err = ControlError::InvalidValueError(format!(
|
||||
Err(AppError::Generic(format!(
|
||||
"{label} frequency ({freq_mhz} MHz) is unreasonably high"
|
||||
));
|
||||
Err(err.into())
|
||||
)))
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue