warning about E

This commit is contained in:
Simon Gardling 2022-03-09 15:50:46 -05:00
parent 408ecacc16
commit 8112d5c2fd

View File

@ -120,7 +120,16 @@ pub fn test_func(function_string: &str) -> Option<String> {
.collect::<Vec<String>>(); .collect::<Vec<String>>();
return match var_names_not_x.len() { return match var_names_not_x.len() {
1 => Some(format!("Error: invalid variable: {}", var_names_not_x[0])), 1 => {
let var_name = &var_names_not_x[0];
if var_name == "e" {
Some(String::from(
"If trying to use Euler's number, please use an uppercase E",
))
} else {
Some(format!("Error: invalid variable: {}", var_name))
}
}
_ => Some(format!("Error: invalid variables: {:?}", var_names_not_x)), _ => Some(format!("Error: invalid variables: {:?}", var_names_not_x)),
}; };
} }