More merge conflicts.
This commit is contained in:
parent
fee8b5c8a1
commit
26c1175a8a
24
src/main.rs
24
src/main.rs
|
@ -6,7 +6,7 @@ extern crate clap;
|
||||||
extern crate futures;
|
extern crate futures;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate lazy_static;
|
extern crate lazy_static;
|
||||||
#[macro_use]CEvent
|
#[macro_use]
|
||||||
extern crate log;
|
extern crate log;
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
|
@ -36,7 +36,7 @@ use app::{
|
||||||
use constants::*;
|
use constants::*;
|
||||||
use data_conversion::*;
|
use data_conversion::*;
|
||||||
use options::*;
|
use options::*;
|
||||||
use utils::error::{self};
|
use utils::error::{self, BottomError};
|
||||||
|
|
||||||
pub mod app;
|
pub mod app;
|
||||||
|
|
||||||
|
@ -465,23 +465,15 @@ fn get_temperature_option(
|
||||||
if let Some(temp_type) = &flags.temperature_type {
|
if let Some(temp_type) = &flags.temperature_type {
|
||||||
// Give lowest priority to config.
|
// Give lowest priority to config.
|
||||||
return match temp_type.as_str() {
|
return match temp_type.as_str() {
|
||||||
"fahrenheit" | "f" => {
|
"fahrenheit" | "f" => Ok(data_harvester::temperature::TemperatureType::Fahrenheit),
|
||||||
Ok(data_harvester::temperature::TemperatureType::Fahrenheit)
|
"kelvin" | "k" => Ok(data_harvester::temperature::TemperatureType::Kelvin),
|
||||||
}
|
"celsius" | "c" => Ok(data_harvester::temperature::TemperatureType::Celsius),
|
||||||
"kelvin" | "k" => {
|
_ => Err(BottomError::ConfigError(
|
||||||
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 \
|
"Invalid temperature type. Please have the value be of the form \
|
||||||
<kelvin|k|celsius|c|fahrenheit|f>"
|
<kelvin|k|celsius|c|fahrenheit|f>"
|
||||||
.to_string(),
|
.to_string(),
|
||||||
))
|
)),
|
||||||
}
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(data_harvester::temperature::TemperatureType::Celsius)
|
Ok(data_harvester::temperature::TemperatureType::Celsius)
|
||||||
|
|
Loading…
Reference in New Issue