generated from ElnuDev/rust-project
panic for undefined variables
This commit is contained in:
parent
b882ef44c0
commit
9686884c62
1 changed files with 1 additions and 1 deletions
|
@ -34,7 +34,7 @@ fn interpolate_string(input: &str, variables: &HashMap<String, Token>) -> String
|
||||||
if let Some(value) = variables.get(var_name) {
|
if let Some(value) = variables.get(var_name) {
|
||||||
value.to_string()
|
value.to_string()
|
||||||
} else {
|
} else {
|
||||||
format!("[{}]", var_name)
|
panic!("undefined variable `{var_name}`");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue