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 12
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/src/main.rs b/src/main.rs
index ff40e97..fdb0558 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,5 +1,4 @@
use std::io;
use std::process;

fn main() {
    println!("Welcome to the temperature converter!");
@@ -20,22 +19,17 @@

        if direction == "q" || direction == "Q" {
            break;
        } if direction != "1" && direction != "2" {
        } else if direction != "1" && direction != "2" {
            println!("Please make a valid selection!");
            continue;
        }

        let direction: u32 = direction.parse().expect("Please type a number!");

        let start_temp = read_temp();

        if direction == 1 {
        if direction == "1" {
            println!("{start_temp}F is equal to {}C",farenheit_to_celsius(start_temp));
        } else if direction == 2 {
            println!("{start_temp}C is equal to {}F", celsius_to_farenheit(start_temp));
        } else {
            println!("Please choose 1 or 2!");
            continue;
            println!("{start_temp}C is equal to {}F", celsius_to_farenheit(start_temp));
        }
    }
}