Diffstat (limited to 'src/main.rs')
1 file changed, 4 insertions(+), 4 deletions(-)
@@ -27,9 +27,9 @@
let start_temp = read_temp();
if direction == "1" {
println!("{start_temp}F is equal to {}C",farenheit_to_celsius(start_temp));
println!("{start_temp}F is equal to {}C",fahrenheit_to_celsius(start_temp));
} else {
println!("{start_temp}C is equal to {}F", celsius_to_farenheit(start_temp));
println!("{start_temp}C is equal to {}F", celsius_to_fahrenheit(start_temp));
}
}
}
@@ -44,10 +44,10 @@
parsed_temp
}
fn farenheit_to_celsius(temp_to_convert: f64) -> f64 {
fn fahrenheit_to_celsius(temp_to_convert: f64) -> f64 {
(temp_to_convert - 32.0) / 1.8
}
fn celsius_to_farenheit(temp_to_convert: f64) -> f64 {
fn celsius_to_fahrenheit(temp_to_convert: f64) -> f64 {
(temp_to_convert * 1.8) + 32.0
}