More merge conflicts.

This commit is contained in:
ClementTsang 2020-03-04 23:48:40 -05:00
parent fee8b5c8a1
commit 26c1175a8a
1 changed files with 189 additions and 197 deletions

View File

@ -6,7 +6,7 @@ extern crate clap;
extern crate futures;
#[macro_use]
extern crate lazy_static;
#[macro_use]CEvent
#[macro_use]
extern crate log;
use std::{
@ -36,7 +36,7 @@ use app::{
use constants::*;
use data_conversion::*;
use options::*;
use utils::error::{self};
use utils::error::{self, BottomError};
pub mod app;
@ -465,23 +465,15 @@ 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(
"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(),
))
}
}
)),
};
}
}
Ok(data_harvester::temperature::TemperatureType::Celsius)