index : temp_converter
Convert temperature degres
about summary refs log tree commit diff
author Justin Zelikoff <justinzelikoff@gmail.com> 2026-08-02 21:24:37 -0400
committer Justin Zelikoff <justinzelikoff@gmail.com> 2026-08-02 21:24:37 -0400
commit 9f419ac63a23f820c52d21798d5149f251a870d1 [patch]
tree cda173b82550e8707966b825a97c9bc05ebe7745
parent 5506f0f712149e644371483c497a7a20acdfec4c
download 9f419ac63a23f820c52d21798d5149f251a870d1.tar.gz

Fixed spelling errors.

Diffstat

-rw-r--r-- README.md 2
-rw-r--r-- src/main.rs 8
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md
index 7a6570c..22c457f 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,3 @@
This is a learning exercise that I did while learning Rust.

CLI program that simply allows conversions between temperatures in Farenheit and Celsius.
CLI program that simply allows conversions between temperatures in Fahrenheit and Celsius.
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
}