index : temp_converter
Convert temperature degres
about summary refs log tree commit diff

Diffstat (limited to 'src/main.rs')

-rw-r--r-- src/main.rs 8
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main.rs b/src/main.rs
index fdb0558..0dcf3c6 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -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
}