Minor touchups to variables prog
This commit is contained in:
parent
ed83cd6b64
commit
8fb44f13ef
@ -37,7 +37,12 @@ fn main() {
|
|||||||
fib_n(n)
|
fib_n(n)
|
||||||
}
|
}
|
||||||
"rx" => redefine_x(),
|
"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);
|
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();
|
let to_convert = to_convert.to_lowercase();
|
||||||
if to_convert.ends_with("c") {
|
if to_convert.ends_with("c") {
|
||||||
let c: f32 = to_convert
|
let c: f32 = to_convert
|
||||||
|
Loading…
x
Reference in New Issue
Block a user