Renamed directory
This commit is contained in:
Generated
+5
@@ -0,0 +1,5 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
[[package]]
|
||||
name = "temp-converter"
|
||||
version = "0.1.0"
|
||||
@@ -0,0 +1,9 @@
|
||||
[package]
|
||||
name = "temp-converter"
|
||||
version = "0.1.0"
|
||||
authors = ["jaketothepast <windlejacob12@gmail.com>"]
|
||||
edition = "2018"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
@@ -0,0 +1,43 @@
|
||||
use std::env;
|
||||
|
||||
fn main() {
|
||||
// Collect our arguments into a vector
|
||||
let args: Vec<String> = env::args().collect();
|
||||
let temp: f64 = args[1].parse().expect("Number");
|
||||
let specifier: char = args[2].parse().expect("not a char");
|
||||
|
||||
let res = match specifier {
|
||||
'c' => to_fahrenheit(temp),
|
||||
'f' => to_celsius(temp),
|
||||
_ => panic!("Not ok")
|
||||
};
|
||||
|
||||
println!("Converted temp is: {:?}", res);
|
||||
}
|
||||
|
||||
fn to_celsius(temp: f64) -> f64 {
|
||||
(temp - 32.) * (5.0 / 9.0)
|
||||
}
|
||||
|
||||
fn to_fahrenheit(temp: f64) -> f64 {
|
||||
temp / 5.0 * 9.0 + 32.
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_f_to_c() {
|
||||
let mynum = 32.;
|
||||
let expected = 0.;
|
||||
|
||||
assert_eq!(to_celsius(mynum), expected);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_f_to_c_boiling() {
|
||||
assert_eq!(to_celsius(212.), 100.);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_c_to_f() {
|
||||
assert_eq!(to_fahrenheit(100.), 212.);
|
||||
assert_eq!(to_fahrenheit(0.), 32.);
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"rustc_fingerprint":14440799327868941031,"outputs":{"1164083562126845933":["rustc 1.44.1 (c7087fe00 2020-06-17)\nbinary: rustc\ncommit-hash: c7087fe00d2ba919df1d813c040a5d47e43b0fe7\ncommit-date: 2020-06-17\nhost: x86_64-apple-darwin\nrelease: 1.44.1\nLLVM version: 9.0\n",""],"4476964694761187371":["___\nlib___.rlib\nlib___.dylib\nlib___.dylib\nlib___.a\nlib___.dylib\n/Users/jacobwindle/.rustup/toolchains/stable-x86_64-apple-darwin\ndebug_assertions\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"sse3\"\ntarget_feature=\"ssse3\"\ntarget_os=\"macos\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"apple\"\nunix\n",""]},"successes":{}}
|
||||
BIN
Binary file not shown.
+1
@@ -0,0 +1 @@
|
||||
This file has an mtime of when this was started.
|
||||
+1
@@ -0,0 +1 @@
|
||||
8b20d2ae7eedad4a
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"rustc":7151530983591731262,"features":"[]","target":12629718435023892152,"profile":8248545651247322450,"path":1036222786711178230,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/temp-converter-541c74692ae718de/dep-test-bin-temp_converter-541c74692ae718de"}}],"rustflags":[],"metadata":15517608058969423672}
|
||||
+1
@@ -0,0 +1 @@
|
||||
599ab1f4c4ed4d24
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"rustc":7151530983591731262,"features":"[]","target":12629718435023892152,"profile":14996655781355331481,"path":1036222786711178230,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/temp-converter-a7d226e9efc0a103/dep-bin-temp-converter"}}],"rustflags":[],"metadata":15517608058969423672}
|
||||
BIN
Binary file not shown.
+1
@@ -0,0 +1 @@
|
||||
This file has an mtime of when this was started.
|
||||
BIN
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
/Users/jacobwindle/CLionProjects/temp-converter/target/debug/deps/temp_converter-541c74692ae718de: src/main.rs
|
||||
|
||||
/Users/jacobwindle/CLionProjects/temp-converter/target/debug/deps/temp_converter-541c74692ae718de.d: src/main.rs
|
||||
|
||||
src/main.rs:
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.apple.xcode.dsym.temp_converter-541c74692ae718de</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>dSYM</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
BIN
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
/Users/jacobwindle/CLionProjects/temp-converter/target/debug/deps/temp_converter: src/main.rs
|
||||
|
||||
/Users/jacobwindle/CLionProjects/temp-converter/target/debug/deps/temp_converter.d: src/main.rs
|
||||
|
||||
src/main.rs:
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.apple.xcode.dsym.temp_converter</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>dSYM</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Executable
Executable
BIN
Binary file not shown.
@@ -0,0 +1 @@
|
||||
/Users/jacobwindle/CLionProjects/temp-converter/target/debug/temp-converter: /Users/jacobwindle/CLionProjects/temp-converter/src/main.rs
|
||||
Reference in New Issue
Block a user