Diffstat (limited to 'src/main.rs')
1 file changed, 11 insertions(+), 1 deletion(-)
@@ -1,4 +1,5 @@
use std::io;
use std::process;
fn main() {
println!("Welcome to the temperature converter!");
@@ -15,7 +16,16 @@
.read_line(&mut direction)
.expect("Failed to read line.");
let direction: u32 = direction.trim().parse().expect("Please type a number!");
let direction = direction.trim();
if direction == "q" || direction == "Q" {
break;
} 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();