From de201f3cfa0b46a4a52f145034bb35c035af28ca Mon Sep 17 00:00:00 2001 From: Dorian Pula Date: Mon, 4 Feb 2019 09:05:11 -0500 Subject: [PATCH] Create a quick calculation and test to make sure it works. --- .gitignore | 1 + Cargo.toml | 2 +- src/lib.rs | 13 ++++++++++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 6936990..d889fbf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target **/*.rs.bk Cargo.lock +.idea diff --git a/Cargo.toml b/Cargo.toml index 5a4b1a3..bb856d4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "embedded-uptime" +name = "embedded-unit-converter" version = "0.1.0" authors = ["Dorian Pula "] edition = "2018" diff --git a/src/lib.rs b/src/lib.rs index 31e1bb2..2002884 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,14 @@ +fn convert_celsius_to_fahrenheit(celsius: f32) -> f32 { + celsius * 1.8 + 32.0 +} + #[cfg(test)] mod tests { + + use super::convert_celsius_to_fahrenheit; + #[test] - fn it_works() { - assert_eq!(2 + 2, 4); + fn conversion_celsius_to_fahrenheit() { + assert_eq!(convert_celsius_to_fahrenheit(25.0), 77.0); } -} +} \ No newline at end of file