Minor touchups to variables prog

This commit is contained in:
Dan Buch 2020-11-28 16:50:12 -05:00
parent ed83cd6b64
commit 8fb44f13ef
Signed by: meatballhat
GPG Key ID: 9685130D8B763EA7

View File

@ -37,7 +37,12 @@ fn main() {
fib_n(n)
}
"rx" => redefine_x(),
"help" | _ => show_help(),
"help" => show_help(),
_ => {
show_help();
eprintln!("ERROR: missing sub-command");
process::exit(1);
}
}
}
@ -58,7 +63,7 @@ fn redefine_x() {
println!("The value of x is: {}", x);
}
fn temp_convert(to_convert: &String) {
fn temp_convert(to_convert: &str) {
let to_convert = to_convert.to_lowercase();
if to_convert.ends_with("c") {
let c: f32 = to_convert