summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorheyrict <xiezh0831@yahoo.co.jp>2020-04-22 17:49:15 +0800
committerheyrict <xiezh0831@yahoo.co.jp>2020-04-22 17:49:15 +0800
commit3b459f4379b08defce50c57a903502513ad1b2b6 (patch)
tree7a0c6ccbf07bcb47e48ac32e40783f4291bab7d7
parent2fb052d68cb46680c081f5a0e25e2c3fbdc9e204 (diff)
fix: Fix clippy
-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(),