From bae259b61cec28710eb99c5661b8bc5fae40eaee Mon Sep 17 00:00:00 2001 From: William Davis Date: Fri, 5 Jan 2024 20:14:43 -0500 Subject: [PATCH] Version bump --- Cargo.toml | 2 +- src/main.rs | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f7f84af..9f605a5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,4 @@ [package] name = "ftoc" -version = "2.0.0" +version = "2.0.1" edition = "2021" diff --git a/src/main.rs b/src/main.rs index 1a819de..1abd17e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -28,16 +28,20 @@ fn main() { .read_line(&mut input) .expect("Failed to read line"); let input = input.trim(); - //Split the input into two strings, input: Contains the number - //and system: Contains if it is celcius or fahrenheit + /* + Split the input into two strings. Input, which contains the number; + and System, which contains if it is celcius or fahrenheit + */ let (input,system) = input.split_at(input.len() - 1); //If the input in a number, output it, else, restart loop let input: f32 = match input.parse() { Ok(num) => num, Err(_) => continue, }; - //If the system is know, call the convert function, else, - //repeat loop + /* + If the system is known, call the convert function, + otherwise repeat loop + */ match system { "C" => println!("{}°C is {:.2}°F", input, convert_to_f(input)), "F" => println!("{}°F is {:.2}°C", input, convert_to_c(input)),