Ordering some files
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
use structopt::clap::arg_enum;
|
||||
|
||||
arg_enum! {
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, Copy)]
|
||||
pub enum TempUnit {
|
||||
Celsius,
|
||||
Fahrenheit
|
||||
}
|
||||
}
|
||||
|
||||
pub fn temp_to_unit_string(temp_unit: &TempUnit) -> String {
|
||||
match temp_unit {
|
||||
TempUnit::Celsius => "°C".to_string(),
|
||||
TempUnit::Fahrenheit => "°F".to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn temp_to_string(temp_unit: &TempUnit) -> String {
|
||||
match temp_unit {
|
||||
TempUnit::Celsius => "celsius".to_string(),
|
||||
TempUnit::Fahrenheit => "fahrenheit".to_string(),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user