summaryrefslogtreecommitdiffstats
path: root/src/formatter/string_formatter.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/formatter/string_formatter.rs')
-rw-r--r--src/formatter/string_formatter.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/formatter/string_formatter.rs b/src/formatter/string_formatter.rs
index 88dfaa52a..19a4bb6fd 100644
--- a/src/formatter/string_formatter.rs
+++ b/src/formatter/string_formatter.rs
@@ -94,9 +94,7 @@ impl<'a> StringFormatter<'a> {
.flat_map(|style| match style {
StyleElement::Text(text) => text.as_ref().chars(),
StyleElement::Variable(name) => {
- let variable = variables
- .get(name.as_ref())
- .expect(&format!("Style variable {} not found in cache", &name));
+ let variable = variables.get(name.as_ref()).unwrap_or(&None);
match variable {
Some(style_string) => style_string.chars(),
None => "".chars(),