diff options
author | Clement Tsang <34804052+ClementTsang@users.noreply.github.com> | 2020-03-08 00:35:01 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-08 00:35:01 -0500 |
commit | 226c4e5a681f66db7bf5a263804332d201ced98c (patch) | |
tree | c50cc51a0211f3873388f3d50618f4e22654764b /src/options.rs | |
parent | 6342686e2243cd8ecb4f47b604caf5520919c34a (diff) |
Clean up and manage some basic stuff (#73)
* Remove debug statement.
* Remove redundant functions from main
* Update pull request template.
* Format temperature line.
* Update README for chocolatey.
* Add note about basic mode and htop's inspiration.
Diffstat (limited to 'src/options.rs')
-rw-r--r-- | src/options.rs | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/options.rs b/src/options.rs index fc92a915..372165bd 100644 --- a/src/options.rs +++ b/src/options.rs @@ -91,20 +91,14 @@ pub fn get_temperature_option( if let Some(temp_type) = &flags.temperature_type { // Give lowest priority to config. return match temp_type.as_str() { - "fahrenheit" | "f" => { - Ok(data_harvester::temperature::TemperatureType::Fahrenheit) - } - "kelvin" | "k" => { - Ok(data_harvester::temperature::TemperatureType::Kelvin) - } - "celsius" | "c" => { - Ok(data_harvester::temperature::TemperatureType::Celsius) - } - _ => { - Err(BottomError::ConfigError( - "Invalid temperature type. Please have the value be of the form <kelvin|k|celsius|c|fahrenheit|f>".to_string() - )) - } + "fahrenheit" | "f" => Ok(data_harvester::temperature::TemperatureType::Fahrenheit), + "kelvin" | "k" => Ok(data_harvester::temperature::TemperatureType::Kelvin), + "celsius" | "c" => Ok(data_harvester::temperature::TemperatureType::Celsius), + _ => Err(BottomError::ConfigError( + "Invalid temperature type. Please have the value be of the form \ + <kelvin|k|celsius|c|fahrenheit|f>" + .to_string(), + )), }; } } |